paint.preprocessing.dwd_weather

Classes

DWDWeatherData

Initialize the DWD weather data object.

Module Contents

class paint.preprocessing.dwd_weather.DWDWeatherData(parameters_10min: list[str], parameters_1h: list[str], station_ids: list[str], start_date: str, end_date: str, output_path: str, file_name: str = 'dwd-weather.h5', ts_shape: str = 'long', ts_humanize: bool = True, ts_si_units: bool = False, compression_method: str = 'gzip', compression_level: int = 5)

Initialize the DWD weather data object.

Parameters

parameters_10minlist[str]

The parameters to be downloaded in a 10min temporal resolution.

parameters_1hlist[str]

The parameters to be downloaded in a 1h temporal resolution.

station_idslist[str]

The station IDs to be considered when downloading data.

start_datestr

The start date of the downloaded data.

end_datestr

The end date of the downloaded data.

output_pathstr

The path to save the downloaded data.

file_namestr

The name of the downloaded data (Default: “dwd_weather”).

ts_shapestr

A string indicating how the time series shape should be handled in the wetterdienst package (Default: long).

ts_humanizebool

A boolean indicating whether the time series should be humanized or not within the wetterdienst package (Default:True).

ts_si_unitsbool
A boolean indicating whether the time series units should be converted to SI units within the

wetterdienst package (Default:False).

compression_methodstr

The method used to compress the HDF5 file.

compression_levelint

The compression level.

parameters_10min
parameters_1h
station_ids
start_date
end_date
output_path
file_name = 'dwd-weather.h5'
settings
compression_opts
_get_raw_data() tuple[pandas.DataFrame, pandas.DataFrame, pandas.DataFrame, pandas.DataFrame]

Download the raw data using the DWD Wetterdienst pacakge.

Returns

pd.DataFrame

The metadata for each weather station included in the 10min temporal resolution data request.

pd.DataFrame

The metadata for each weather station included in the 1h temporal resolution data request.

pd.DataFrame

The data for the weather variables downloaded in 10min temporal resolution.

pd.DataFrame

The data for the weather variables downloaded in 1h temporal resolution.

download_and_save_data() pandas.DataFrame

Download the desired DWD weather data and save it to an HDF5 file.

Returns

pd.Dataframe

The metadata used for creating the STAC item.