solarpy.iotools.get_dmi_station_meta

solarpy.iotools.get_dmi_station_meta#

solarpy.iotools.get_dmi_station_meta(station, entry_no=-1, url='https://opendataapi.dmi.dk/v2/climateData/', **kwargs)#

Retrieve metadata for a DMI climate station.

Parameters:
  • station (str) – DMI station identifier, e.g. '06180' for Copenhagen Airport.

  • entry_no (int, default -1) – Index into the list of station entries returned by the API. The default of -1 selects the most recent entry, which is appropriate for stations that have been relocated over time.

  • url (str, optional) – Base URL for the DMI Climate Data API.

  • **kwargs – Additional keyword arguments forwarded to requests.get(), e.g. timeout=30.

Returns:

meta – Station metadata with keys 'station_id', 'name', 'latitude', 'longitude', 'altitude', and 'country'.

Return type:

dict

Notes

The DMI Climate Data API is documented at https://www.dmi.dk/friedata/dokumentation/apis/climate-data-api-1. A list of stations can be found at https://www.dmi.dk/friedata/dokumentation/data/climate-data-stations.

Examples

>>> import solarpy
>>> meta = solarpy.iotools.get_dmi_station_meta('06188', timeout=30)