Conversion between different bases¶
Perform base conversions
Currently supports conversion between base 10 (decimal) and base 60 (sexagesimal).
- sapphire.transformations.base.decimal_to_sexagesimal(decimal)¶
Convert decimal hours or degrees to sexagesimal.
- Parameters:
decimal – decimal number to be converted to sexagismal.
- Returns:
tuple of either (hours, minutes, seconds) or (degrees, arcminutes, arcseconds).
- sapphire.transformations.base.sexagesimal_to_decimal(hd, minutes, seconds)¶
Convert sexagesimal hours or degrees to decimal.
Warning! Ensure each part has the correct sign. e.g. -111d36m12s should be entered as (-111, -36, -12).
- Parameters:
hd – hours or degrees.
minutes – minutes or arcminutes.
seconds – seconds or arcseconds.
- Returns:
decimal hours or degrees.