Utilities

aeolus.util.fmt_lonlat(value, lon_or_lat, degree=False)[source]

Convert longitude or latitude value to string with a hemisphere identifier.

Parameters
  • value (int) – Value of longitude or latitude. Note that this function is only for integer values.

  • lon_or_lat (str) – Longitude or latitude

  • degree (bool, optional) – If true, a TeX degree symbol is included

Returns

Return type

str

Examples

>>> fmt_lonlat(-25, "lon")
'25W'
>>> fmt_lonlat(89, "lat", degree=True)
'89$^\\degree$N'
>>> fmt_lonlat(0, "lon")
'0'