lsst.utils  15.0-3-g9103c06+9
Functions
Right Ascension and Declination Parsers

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=":")
 

Detailed Description

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

Function Documentation

◆ decDegToStr()

std::string lsst::utils::decDegToStr ( double  decDeg)

Definition at line 101 of file RaDecStr.cc.

◆ decRadToStr()

std::string lsst::utils::decRadToStr ( double  decRad)

Definition at line 96 of file RaDecStr.cc.

◆ decStrToDeg()

double lsst::utils::decStrToDeg ( std::string  decStr,
std::string  delimiter = ":" 
)

Definition at line 215 of file RaDecStr.cc.

◆ decStrToRad()

double lsst::utils::decStrToRad ( std::string  decStr,
std::string  delimiter = ":" 
)

Definition at line 210 of file RaDecStr.cc.

◆ degToRad()

double degToRad ( long double  angleInDegrees)

Definition at line 66 of file RaDecStr.cc.

◆ raDecDegToStr()

std::string lsst::utils::raDecDegToStr ( double  raDeg,
double  decDeg 
)

Definition at line 133 of file RaDecStr.cc.

◆ raDecRadToStr()

std::string lsst::utils::raDecRadToStr ( double  raRad,
double  decRad 
)

Definition at line 126 of file RaDecStr.cc.

◆ raDegToStr()

std::string lsst::utils::raDegToStr ( double  raDeg)

Definition at line 78 of file RaDecStr.cc.

◆ radToDeg()

double radToDeg ( long double  angleInRadians)

Definition at line 60 of file RaDecStr.cc.

◆ raRadToStr()

std::string lsst::utils::raRadToStr ( double  raRad)

Convert a right ascension in radians to a string format.

Parameters
raRadRa in radians

Definition at line 74 of file RaDecStr.cc.

◆ raStrToDeg()

double lsst::utils::raStrToDeg ( std::string  raStr,
std::string  delimiter = ":" 
)

Definition at line 199 of file RaDecStr.cc.

◆ raStrToRad()

double lsst::utils::raStrToRad ( std::string  raStr,
std::string  delimiter = ":" 
)

Definition at line 194 of file RaDecStr.cc.

◆ sexagesimalStrToDecimal()

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.

Parameters
inStrString to parse and convert
delimiterDelimiter separating minutes and seconds from hours or degrees.

Definition at line 156 of file RaDecStr.cc.