lsst.utils
14.0-12-g9103c06+1
|
Routines for converting right ascension and declination from degrees or radians into strings and back again. More...
Functions | |
double | radToDeg (long double angleInRadians) |
double | degToRad (long double angleInDegrees) |
double | sexagesimalStrToDecimal (std::string inStr, std::string delimiter) |
Convert a sexagesimal string to a decimal double. More... | |
std::string | lsst::utils::raRadToStr (double raRad) |
Convert a right ascension in radians to a string format. More... | |
std::string | lsst::utils::raDegToStr (double raDeg) |
std::string | lsst::utils::decRadToStr (double decRad) |
std::string | lsst::utils::decDegToStr (double decDeg) |
std::string | lsst::utils::raDecRadToStr (double raRad, double decRad) |
std::string | lsst::utils::raDecDegToStr (double raDeg, double decDeg) |
double | lsst::utils::raStrToRad (std::string raStr, std::string delimiter=":") |
double | lsst::utils::raStrToDeg (std::string raStr, std::string delimiter=":") |
double | lsst::utils::decStrToRad (std::string decStr, std::string delimiter=":") |
double | lsst::utils::decStrToDeg (std::string decStr, std::string delimiter=":") |
Routines for converting right ascension and declination from degrees or radians into strings and back again.
Right ascensions and declinations (raDecs) are easiest read as strings in the form hh:mm:ss.ss +dd:mm::ss.s, but for calculations, they need to be in degrees or radians. These functions perform those calculations. The function names themselves use the following abbreviations
So, for example raStrToRad() converts a right ascension in the form of a string to radians.
The ouput strings are in fixed length Ra = hh:mm:ss.ss and Dec= +dd:mm::ss.s with all zeros present (not replaced with whitespace).
Input strings must be of a similar format, although some variation is allowed. The default delimiter (the colon) can be supplied as an optional argument
std::string lsst::utils::decDegToStr | ( | double | decDeg | ) |
Definition at line 101 of file RaDecStr.cc.
std::string lsst::utils::decRadToStr | ( | double | decRad | ) |
Definition at line 96 of file RaDecStr.cc.
double lsst::utils::decStrToDeg | ( | std::string | decStr, |
std::string | delimiter = ":" |
||
) |
Definition at line 215 of file RaDecStr.cc.
double lsst::utils::decStrToRad | ( | std::string | decStr, |
std::string | delimiter = ":" |
||
) |
Definition at line 210 of file RaDecStr.cc.
double degToRad | ( | long double | angleInDegrees | ) |
Definition at line 66 of file RaDecStr.cc.
std::string lsst::utils::raDecDegToStr | ( | double | raDeg, |
double | decDeg | ||
) |
Definition at line 133 of file RaDecStr.cc.
std::string lsst::utils::raDecRadToStr | ( | double | raRad, |
double | decRad | ||
) |
Definition at line 126 of file RaDecStr.cc.
std::string lsst::utils::raDegToStr | ( | double | raDeg | ) |
Definition at line 78 of file RaDecStr.cc.
double radToDeg | ( | long double | angleInRadians | ) |
Definition at line 60 of file RaDecStr.cc.
std::string lsst::utils::raRadToStr | ( | double | raRad | ) |
Convert a right ascension in radians to a string format.
raRad | Ra in radians |
Definition at line 74 of file RaDecStr.cc.
double lsst::utils::raStrToDeg | ( | std::string | raStr, |
std::string | delimiter = ":" |
||
) |
Definition at line 199 of file RaDecStr.cc.
double lsst::utils::raStrToRad | ( | std::string | raStr, |
std::string | delimiter = ":" |
||
) |
Definition at line 194 of file RaDecStr.cc.
double sexagesimalStrToDecimal | ( | std::string | inStr, |
std::string | delimiter | ||
) |
Convert a sexagesimal string to a decimal double.
Helper function to parse sexagesimal string in either hours:minutes:seconds or degrees:minutes:seconds, and then convert this to a decimal double. Note that no conversion between hours and degrees is performed.
inStr | String to parse and convert |
delimiter | Delimiter separating minutes and seconds from hours or degrees. |
Definition at line 156 of file RaDecStr.cc.