Go to the documentation of this file.
40 opts.AddProgramDescription(std::string() +
41 "Takes observed positions (azimuth,zenith angle) and computes the " +
42 "Galactic longitude,latitude positions based on the observer location " +
43 "and atmospheric properties. The only values necessary to get rough " +
44 "coordinates are 'longitude', 'latitude', 'azimuth', 'zenith', and " +
48 opts.AddObserverPars();
49 opts.AddObservedPars();
61 std::printf(
"**********************************************\n") ;
62 std::printf(
"* Results of Observed -> Galactic conversion *\n") ;
63 std::printf(
"**********************************************\n") ;
64 std::printf(
"Observed Coordinates (input)\n") ;
65 std::printf(
" Azimuth : %f degrees\n", inputs.AsDouble(
"azimuth")) ;
66 std::printf(
" Zenith : %+f degrees\n", inputs.AsDouble(
"zenith")) ;
67 std::printf(
" Altitude : %+f degrees\n", 90.0-inputs.AsDouble(
"zenith")) ;
68 std::printf(
"Galactic Coordinates (output)\n") ;
69 std::printf(
" G. Longitude : %f degrees\n", results.
XCoord().
Deg()) ;
70 std::printf(
" G. Latitude : %+f degrees\n", results.
YCoord().
Deg()) ;
71 std::printf(
"Observer Info\n") ;
72 std::printf(
" Julian Date : %f\n", inputs.AsDouble(
"juliandate")) ;
73 std::printf(
" Longitude : %f deg\n", inputs.AsDouble(
"longitude")) ;
74 std::printf(
" Latitude : %+f deg\n", inputs.AsDouble(
"latitude")) ;
75 std::printf(
" Elevation : %f meters\n", inputs.AsDouble(
"elevation")) ;
76 std::printf(
" Pressure : %f hPa\n", inputs.AsDouble(
"pressure")) ;
77 std::printf(
" Temperature : %f Celsius\n", inputs.AsDouble(
"temperature")) ;
78 std::printf(
" Relative Humid.: %f\n", inputs.AsDouble(
"humidity")) ;
84 int main(
int argc,
char** argv) {
88 if (opts.ParseCommandLine(argc, argv))
return 0;
91 CEObserver observer(opts.AsDouble(
"longitude"),
92 opts.AsDouble(
"latitude"),
93 opts.AsDouble(
"elevation"),
96 observer.SetTemperature_C(opts.AsDouble(
"temperature"));
97 observer.SetRelativeHumidity(opts.AsDouble(
"humidity"));
98 observer.SetWavelength_um(opts.AsDouble(
"wavelength"));
void SetPressure_hPa(const double &pressure=CppEphem::EstimatePressure_hPa(CppEphem::SeaLevelTemp_C()))
Set the observer's pressure.
CEExecOptions DefineOpts()
void PrintResults(CEExecOptions &inputs, const CESkyCoord &results)
CESkyCoord ConvertToGalactic(const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
Convert this coordinate to GALACTIC coordinates.
double Deg(void) const
Return angle in degrees as a double.
int main(int argc, char **argv)
static CEAngle Deg(const double &angle)
Return angle (radians) constructed from a degree angle.
virtual CEAngle XCoord(const CEDate &jd=CppEphem::julian_date_J2000()) const
Return x coordinate at given Julian date.
Azimuth, Zenith (requires additional observer information)
virtual CEAngle YCoord(const CEDate &jd=CppEphem::julian_date_J2000()) const
Return y coordinate at given Julian date.