pymgp.crstrans.deg2dms#

pymgp.crstrans.deg2dms(value, pretty=False, unit='rad')[source]#

Convert latitude/longitude angles into a string with degrees, minutes and second format.

Parameters:
valuefloat

Value to convert.

unit{‘rad’, ‘deg’, ‘rad/m’, ‘deg/m’}, optional, default = ‘rad’

Unit of the values (only ‘rad’ and ‘deg’ are meaningful).

prettyboolean, optional, default=False

Pretty print with degree, minute and second symbol.

Returns:
dmsstr

Sring with output in dms format.

Notes

One degree is about 111 km along the meridian, one minute is 1850 m (one nautical mile), one second is 31 m, one milliarcsecond (mas) is 31 mm. The print resolution for the latitude, or longitude at the equator, is 0.01 mas, or 0.31 mm, in normal mode, and 0.1 mas, or 3.1 mm, in pretty print mode.

Examples

>>> deg2dms(0.9)
' 51 34 58.32562'
>>> print(deg2dms(23.234567, unit='deg', pretty=True))
 23°14'04.4412"