• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • astro
eclsolar.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2012 Gerhard HOLTKAMP
9 //
10 
11 #if !defined(__eclsolar_h)
12 #define __eclsolar_h
13 
14 #include "attlib.h"
15 #include "astrolib_export.h"
16 
17 const int GBL_ECLBUF = 12; // maximum number of eclipses allowed
18 const int MAXLUN = 15;
19 
20 typedef double PMJD[MAXLUN]; // array of MJD's of the respective phase
21 
22 class ASTROLIB_EXPORT EclSolar // Calculate Solar Eclipses
23 {
24  public:
25  EclSolar();
26  ~EclSolar();
27 
28  int getYear() const; // the year currently used by EclSolar
29  void putYear(int yr); // set the year to be used by EclSolar
30  int getNumberEclYear(); // get the number of eclipses of the currently selected year
31  void setLunarEcl(bool lecl); // include lunar eclipses
32  void setStepWidth(double s); // set the step width (minutes)
33  void setTimezone(double d); // set timezone for I/O
34  void setDeltaTAI_UTC(double d); // set IERS Parameter TAI - UTC
35  void setAutoTAI_UTC(); // IERS Parameter TAI - UTC to auto
36  void setLocalPos(double lat, double lng, double hgt); // set local geographic coordinates
37  void getLocalDetails(char *otxt); // provide eclipse details for local position
38  void setCurrentMJD(int year, int month, int day, int hour, int min, double sec); // set current time
39  void getDatefromMJD(double mjd, int &year, int &month, int &day,
40  int &hour, int &min, double &sec) const; // convert MJD into date and time
41  int getLocalVisibility(double &mjd_start, double &mjd_stop); // local start and stop times for eclipse
42  int getLocalTotal(double &mjd_start, double &mjd_stop); // local start and stop times for totality/annularity
43  int getLocalMax(double &mjdmax, double &magmax, double &elmax); // get local (solar) eclipse maximum
44  int getPenumbra(double &mjd_start, double &mjd_stop); // start and stop times for penumbral eclipse of Moon
45  int getPartial(double &mjd_start, double &mjd_stop); // (global) start and stop times for partial phase
46  int getTotal(double &mjd_start, double &mjd_stop); // (global) start and stop times for totality/annularity
47  void getEclYearInfo(char* wbuf); // list of eclipses of the year
48  int getEclYearInfo(int k, int &yr, int &month, int &day,
49  int &hour, int &min, double &sec, double &tzone, double &magn);
50  int getEclTxt (int j, char* jtxt); // get text for j-th eclipse
51  void putEclSelect(int es); // select particular eclipse for details
52  void nextEcl(); // select the next eclipse for details
53  void previousEcl(); // select the previous eclipse for details
54  double getLastMJD() const; // get the MJD last used in calculations
55  void getMaxPos(double &lat, double &lng); // get position of maximum eclipse
56  int eclPltCentral(bool firstc, double &lat, double &lng); // calc central eclipse line
57  int GNSBound(bool firstc, bool north, double& lat, double& lng); // northern or southern boundary
58  int GRSBound(bool firstc, double& lat1, double& lng1, double& lat2, double& lng2);
59  // Rise / Set Boundary
60  int centralBound(bool firstc, double& lat1, double& lng1, double& lat2, double& lng2);
61  void getShadowCone(double mjd, bool umbra, int numpts, double* lat, double* lng);
62  void setPenumbraAngle(double pa, int mode);
63 
64  private:
65  void esinit(); // initialize EclSolar
66  static double atan23 (double y, double x); // atan without singularity for x,y=0
67  void DefTime (); // Get System Time and Date
68  void calcMaxPos(double &lat, double &lng); // get position of maximum eclipse
69  static void GetMonth (int mm, char* mchr);
70  static double phmjd (double yearf, double phase, double tdut,
71  int& eph, double& ejd, double& emag);
72  void ckphase (double minmjd, double maxmjd, double yr,
73  double deltdut, int &mp, PMJD p, double phase);
74  static void dtmstr(double jdmoon, char *dts);
75  void moonph(); // calculate phases of the Moon
76  void eclStart(); // initialize detailed calcs for selected eclipse
77  static double getlocmag(double jd, double ep2, double phi, double lamda,
78  double height, Vec3 rs, Vec3 rm, int& totflg);
79  static int iscrs(double vrc0, double vrc1, double dpn,
80  double& vrx0, double& vrx1, double& vrx20, double& vrx21);
81  void InitBound(); // initialize boundary calcs
82  void InRSBound(); // initialize Sunrise/Sunset boundaries
83  static double DegFDms (double h);
84  int localStart(int j, double *spt, double *ept, int *spp,
85  int p, char *otxt);
86  static double navCourse (double lat1, double lng1, double lat2, double lng2); // navigation course from p1 to p2
87  static void navNewPos (double d, double an, double lat1, double lng1, double &lat2, double &lng2);
88  static double sunObscure(double l1, double l2, double m); // get the Obscuration of the Sun
89 
90  // data fields
91 
92  bool eb_start_called; // true if eclStart() has already been called for eclipse
93  bool eb_moonph_called; // true if moonph has already been called for year
94  bool eb_lunecl; // true if lunar eclipses are to be included
95  bool eb_lunactive; // true if current eclipse is a lunar eclipse
96  bool eb_local_called; // true if local circumstances calculated
97 
98  int eb_day; // date
99  int eb_month;
100  int eb_year;
101  int eb_hour;
102  int eb_minute;
103  int eb_second;
104  double eb_time;
105  double eb_tzone; // timezone in hours
106  double eb_del_tdut; // TDT - UT in sec
107  int eb_del_auto; // 1 = automatic del_tdut, 0 = manual
108  double eb_geolat; // geographic coordinates (angles in degrees)
109  double eb_geolong;
110  double eb_geoheight; // in meters
111  int eb_lstcall; // 1 = last call moonph; 2 = caldisp; 0 = no call
112  int eb_locecl; // 1 = local eclipse call; 0 = normal (global) call
113 
114  bool eb_finished; // true if the loop run on consecutive calls is finished
115  bool eb_finished2;
116  int eb_numecl; // number of eclipses of the year;
117  int eb_eclselect; // eclipse selected for detailed calculation
118  int eb_lastyear; // last year for which moon phases were calculated
119  double eb_lasttz; // last used timezone
120  double eb_lastdlt; // last delta-t used
121  int eb_cstep; // step width in minutes used for central eclipse output
122  double eb_eclmjd [GBL_ECLBUF]; // the MJD's of the middle of the eclipses
123  double eb_magnitude [GBL_ECLBUF]; // magnitude of respective eclipse
124  int eb_phase [GBL_ECLBUF]; // phase of the eclipse. 0 if no eclipse,
125  // 1 partial Sun, 2 non-central annular, 3 non-central total,
126  // 4 annular, 5 total, 6 annual/total Sun
127  // -1 partial penumbral Moon, -2 penumbral Moon,
128  // -3 partial Moon, -4 total Moon.
129  int eb_nphase; // number of phases for eclipse details
130  int eb_spp[4]; // kind of eclipse phase i
131  double eb_spt[4]; // start time in MJD for phase i
132  double eb_ept[4]; // end time in MJD for phase i
133  int eb_lccnt; // = 0 not visible, 1,2 = first rise/set; 3,4 second r/s
134  double eb_lcb1, eb_lcb2, eb_lce1, eb_lce2; // rise and set times (up to 2 possible)
135  double eb_jdmaxps; // MJD of maximum phase
136  double eb_maxps; // value of maximum phase
137  double eb_maxelv; // elevation at maximum phase
138  double eb_ltotb; // begin of totality/annularity at local position
139  double eb_ltote; // end of totality/annularity at local position
140  int eb_cphs; // phase of the central eclipse for center line plotting
141  double eb_clat; // current latitude of center line (in decimal degrees)
142  double eb_clng; // current longitude of center line (in decimal degrees)
143  double eb_cmxlat; // latitude of maximum eclipse (in decimal degrees)
144  double eb_cmxlng; // longitude of maximum eclipse (in decimal degrees)
145  double eb_jdstart; // (global) start jd of eclipse
146  double eb_jdstop; // (global) end jd of eclipse
147  double eb_lastjd; // last used MJD for eclipse calcs
148  double eb_dpb; // Base value for diameter of penumbra
149  double eb_dpd; // delta value for diameter of penumbra
150  double eb_penangle; // factor for multiplying the penumbra angle (1.0 for normal borders)
151  int eb_penamode; // mode for using eb_penangle
152  Vec3 eb_ubm; // Penumbra (or Umbra or Moon) base vector
153  Vec3 eb_ube; // Shadow base vector for upper boundary
154  Vec3 eb_udm; // Penumbra base delta vector
155  Vec3 eb_ude; // Shadow delta vector for upper boundary
156  Vec3 eb_lbe; // Shadod base vector for lower boundary
157  Vec3 eb_lde; // Shadow delta vector for lower boundary
158 
159 };
160 
161 #endif // __eclsolar_h sentry.
162 
Vec3
Definition: attlib.h:27
GBL_ECLBUF
const int GBL_ECLBUF
Definition: eclsolar.h:17
ASTROLIB_EXPORT
#define ASTROLIB_EXPORT
Definition: astrolib_export.h:20
attlib.h
EclSolar
Definition: eclsolar.h:22
MAXLUN
const int MAXLUN
Definition: eclsolar.h:18
astrolib_export.h
mjd
double mjd(int day, int month, int year, double hour)
Definition: astrolib.cpp:94
PMJD
double PMJD[MAXLUN]
Definition: eclsolar.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal