lair.geo.dms2dd#

lair.geo.dms2dd(d=0.0, m=0.0, s=0.0)[source]#

Degree-minute-second to decimal degree

The sign of d applies to the whole angle (m and s are magnitudes), so dms2dd(-40, 30) is -40.5. For angles between 0 and -1 degree pass d=-0.0.

Parameters:
  • d (float, optional) – Degrees, by default 0.0

  • m (float, optional) – Minutes, by default 0.0

  • s (float, optional) – Seconds, by default 0.0

Returns:

float – Decimal degrees, or NaN if any input cannot be converted to a float (e.g. None or a non-numeric string).

Return type:

float

See also

wrap_lons

Puts longitudes in one range.

Examples

>>> from lair.geo import dms2dd
>>> dms2dd(40, 45, 36)
40.76
>>> dms2dd(-111, 53, 24)
-111.89