Go to the documentation of this file.
37 int main(
int argc,
char** argv)
41 if (opts.ParseCommandLine(argc,argv))
return 0;
46 if (!opts.AsBool(
"InputDegrees")) {
52 opts.AsDouble(
"ycoord1"),
53 opts.AsBool(
"InputDegrees"));
55 opts.AsDouble(
"ycoord2"),
56 opts.AsBool(
"InputDegrees"));
61 if (opts.AsBool(
"OutputDegrees")) {
62 std::cout << angsep.Deg() << std::endl;
64 std::cout << angsep.Rad() << std::endl;
78 opts.AddProgramDescription(std::string() +
79 "Computes the angular separation between two coordinates. Note that " +
80 "the coordinate types need to be the same for both positions.");
83 opts.AddBoolParam(
"InputDegrees",
84 "Specifies whether input angles are in degrees (1) or radians (0)",
86 opts.AddBoolParam(
"OutputDegrees",
87 "Specifies whether to output the angular separation in degrees (1) or radians (0)",
89 opts.AddDoubleParam(
"xcoord1",
90 "X-coordinate for first position. Should be either 'right ascension' or 'galactic longitude'",
92 opts.AddDoubleParam(
"ycoord1",
93 "Y-coordinate for first position. Should be either 'declination' or 'galactic latitude'",
95 opts.AddDoubleParam(
"xcoord2",
96 "X-coordinate for second position. Should be either 'right ascension' or 'galactic longitude'",
98 opts.AddDoubleParam(
"ycoord2",
99 "Y-coordinate for second position. Should be either 'declination' or 'galactic latitude'",
RA, Dec (referenced at the barycenter of the solarsystem)
CESkyCoord ConstructCoords(const double &x, const double &y, bool isDeg)
Construct the coordinates object.
virtual CEAngle AngularSeparation(const CESkyCoord &coords) const
Get the angular separation between the coordinates represented by this object and another coordinate ...
int main(int argc, char **argv)
double Rad(void) const
Return angle in radians as a double.
CEExecOptions DefineOpts()
Set the command line options.
double Deg(void) const
Return angle in degrees as a double.
virtual void SetCoordinates(const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS) const
Set the coordinates of this object.