obspy.geodetics.base.kilometers2degrees

kilometers2degrees(kilometer, radius=6371)[source]

Convenience function to convert kilometers to degrees assuming a perfectly spherical Earth.

Parameters:
  • kilometer (float) Distance in kilometers
  • radius (int, optional) Radius of the Earth used for the calculation.
Return type:

float

Returns:

Distance in degrees as a floating point number.

Example

>>> from obspy.geodetics import kilometers2degrees
>>> kilometers2degrees(300)
2.6979648177561915