FACT++  1.0
Moon::Moon ( double  lon,
double  lat,
const Time t = Time() 
)
inline

Definition at line 40 of file moon.cc.

References Time::JD(), and lat.

40  : time(t)
41  {
42  const double JD = time.JD();
43 
44  ln_lnlat_posn observer;
45  observer.lng = lon;
46  observer.lat = lat;
47 
48  ln_rst_time moon;
49  ln_get_lunar_rst(JD-0.5, &observer, &moon);
50 
51  fRise = Time(moon.rise);
52  fTransit = Time(moon.transit);
53  fSet = Time(moon.set);
54 
55  //visible =
56  // ((JD>moon.rise && JD<moon.set ) && moon.rise<moon.set) ||
57  // ((JD<moon.set || JD>moon.rise) && moon.rise>moon.set);
58 
59  const bool is_up = JD>moon.rise;
60  const bool is_sinking = JD>moon.transit;
61  const bool is_dn = JD>moon.set;
62 
63  ln_get_lunar_rst(JD+0.5, &observer, &moon);
64  if (is_up)
65  fRise = Time(moon.rise);
66  if (is_sinking)
67  fTransit = Time(moon.transit);
68  if (is_dn)
69  fSet = Time(moon.set);
70 
71  ln_equ_posn pos;
72  ln_get_lunar_equ_coords(JD, &pos);
73 
74  ln_hrz_posn hrz;
75  ln_get_hrz_from_equ (&pos, &observer, JD, &hrz);
76  az = hrz.az;
77  zd = 90-hrz.alt;
78 
79  ra = pos.ra/15;
80  dec = pos.dec;
81 
82  disk = ln_get_lunar_disk(JD)*100;
83  state = 0;
84  if (fRise <fTransit && fRise <fSet) state = 0; // not visible
85  if (fTransit<fSet && fTransit<fRise) state = 1; // before culm
86  if (fSet <fRise && fSet <fTransit) state = 2; // after culm
87 
88  visible = state!=0;
89 
90  // 0: not visible
91  // 1: visible before cul
92  // 2: visible after cul
93  }
int state
Definition: moon.cc:32
double ra
Definition: moon.cc:18
double dec
Definition: moon.cc:19
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
double JD() const
Definition: Time.h:87
Time time
Definition: moon.cc:16
double zd
Definition: moon.cc:21
Time fTransit
Definition: moon.cc:29
float lat
Definition: HeadersGPS.h:23
double az
Definition: moon.cc:22
Time fSet
Definition: moon.cc:30
double disk
Definition: moon.cc:24
Time fRise
Definition: moon.cc:28
bool visible
Definition: moon.cc:26

+ Here is the call graph for this function: