Machinery

DWD (German Weather Service)

class wetterdienst.provider.dwd.radar.access.RadarResult(data, timestamp=None, url=None, filename=None)

Result object encapsulating radar data and metadata. Currently, this will relate to exactly one radar data file.

wetterdienst.provider.dwd.radar.access.collect_radar_data(parameter, resolution=None, period=None, site=None, fmt=None, subset=None, elevation=None, start_date=None, end_date=None, verify=True)

Collect radar data for given parameters.

Parameters
  • parameter (Optional[DwdRadarParameter]) – The radar moment to request

  • resolution (Optional[Resolution]) – Time resolution for RadarParameter.RADOLAN_CDC, either daily or hourly or 5 minutes.

  • period (Optional[Period]) – Period type for RadarParameter.RADOLAN_CDC

  • site (Optional[DwdRadarSite]) – Site/station if parameter is one of RADAR_PARAMETERS_SITES

  • fmt (Optional[DwdRadarDataFormat]) – Data format (BINARY, BUFR, HDF5)

  • subset (Optional[DwdRadarDataSubset]) – The subset (simple or polarimetric) for HDF5 data.

  • elevation (Optional[int]) –

  • start_date (Optional[datetime]) – Start date

  • end_date (Optional[datetime]) – End date

  • verify (Optional[bool]) – Whether to verify the response

Return type

RadarResult

Returns

RadarResult item

wetterdienst.provider.dwd.radar.access.download_radolan_data(url, start_date, end_date)

Function used to download RADOLAN_CDC data for a given datetime. The function calls a separate download function that is cached for reuse which is especially used for historical data that comes packaged for multiple time steps within a single archive. :type url: str :param url: The URL to the file that has the data

for the requested datetime, either an archive of multiple files for a datetime in historical time or an archive with one file for the recent RADOLAN file

Parameters
  • start_date

  • end_date

Return type

RadarResult

Returns

RadarResult item

wetterdienst.provider.dwd.radar.access.should_cache_download(url)

Determine whether this specific result should be cached.

Here, we don’t want to cache any files containing “-latest-” in their filenames.

Parameters

url (str) – url string which is used to decide if result is cached

Return type

bool

Returns

When cache should be dismissed, return False. Otherwise, return True.