158 if (!conf.DoParse(argc, argv))
161 if (conf.Has(
"ra")^conf.Has(
"dec"))
163 cout <<
"ERROR - Either --ra or --dec missing." << endl;
168 time.
SetFromStr(conf.Get<
string>(
"date-time"));
170 ln_lnlat_posn observer;
171 observer.lng = -(17.+53./60+26.525/3600);
172 observer.lat = 28.+45./60+42.462/3600;
174 Moon moon(observer.lng, observer.lat, time);
176 cout << setprecision(15);
181 ln_get_solar_equ_coords(time.
JD(), &pos);
182 ln_get_hrz_from_equ(&pos, &observer, time.
JD(), &hrz);
183 cout << 90-hrz.alt <<
'\n';
185 const double kSynMonth = 29.53058868;
186 const double kEpoch0 = 44240.37917;
187 const double kInstall = 393;
188 const uint32_t
period = floor(((time.
Mjd()-kEpoch0)/kSynMonth-kInstall));
190 cout << period <<
'\n';
191 cout << moon.visible <<
'\n';
192 cout << moon.disk <<
'\n';
193 cout << moon.zd <<
'\n';
195 if (conf.Has(
"ra") && conf.Has(
"dec"))
197 pos.ra = conf.Get<
double>(
"ra")*15;
198 pos.dec = conf.Get<
double>(
"dec");
200 cout << moon.Angle(pos.ra/15, pos.dec) <<
'\n';
207 cout << moon.Angle(pos.ra/15, pos.dec) <<
'\n';
void SetupConfiguration(Configuration &conf)
Adds some functionality to boost::posix_time::ptime for our needs.
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Commandline parsing, resource file parsing and database access.
void SetFromStr(const std::string &str, const char *fmt="%Y-%m-%d %H:%M:%S")
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const