aixweather.imports package

AixWeather Imports Package

The ‘imports’ package within AixWeather contains modules for importing raw weather data from various sources, including pulling data from DWD (Deutscher Wetterdienst) or reading files from local drives. Each module is designed to handle data from a specific source or format.

The output is as raw as possible.

Submodules

aixweather.imports.DWD module

imports weather data from the DWD

aixweather.imports.DWD.import_DWD_forecast(station: str) DataFrame[source]

Import weather forecast data from the DWD (German Weather Service) for a specified station.

Args:
station (str): Station ID of the DWD for which forecast data is to be imported.

For debugging purposes: station 01028.

Returns:

pd.DataFrame: DataFrame containing weather forecast data from the DWD.

aixweather.imports.DWD.import_DWD_historical(start: datetime, station: str) DataFrame[source]

Pull historical data from DWD: (https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/) and format them into a dataframe.

Args:

start: defines how much data must be pulled station: station id of the DWD

Returns:

Dataframe weather data from DWD that is as raw as possible.

aixweather.imports.DWD.import_meta_DWD_forecast(station: str) MetaData[source]

Downloads and extracts metadata related to the specified station from the DWD (Deutscher Wetterdienst) Open Data Interface.

Parameters:

station: Station ID for which metadata is to be retrieved.

Returns:

meta (meta_data object): An object of the meta_data class with populated attributes related to the station.

aixweather.imports.DWD.import_meta_DWD_historical(station: str) MetaData[source]

Downloads and extracts metadata related to the specified station from the DWD (Deutscher Wetterdienst) Open Data Interface.

Parameters:

station: Station ID for which metadata is to be retrieved.

Returns:

meta (meta_data object): An object of the meta_data class with populated attributes related to the station.

aixweather.imports.EPW module

import epw files

aixweather.imports.EPW.load_epw_from_file(path: str) DataFrame[source]

Import data from an EPW file and convert it into a DataFrame.

Args:

path (str): The absolute path to the EPW file.

Returns:

pd.DataFrame: A DataFrame containing the imported data from the EPW file.

aixweather.imports.EPW.load_epw_meta_from_file(path: str) MetaData[source]

Load an EPW file from a specified path and parse the file header for metadata.

Args:

path (str): The file path to the EPW file to be loaded.

Returns:

MetaData: An object containing the parsed metadata from the EPW file.

aixweather.imports.ERC module

contains functions to handle data within ERC

aixweather.imports.ERC.import_ERC(start: datetime, stop: datetime, cred: tuple) DataFrame[source]

Import weather data from aedifion ERC weather station (credentials required).

Args:

start (datetime): Datetime object representing the data start. stop (datetime): Datetime object representing the data stop. cred (tuple): Aedifion credentials.

Returns:

pd.DataFrame: DataFrame containing as raw as possible weather data from aedifion ERC.

aixweather.imports.ERC.import_meta_from_ERC() MetaData[source]

Import (specify) metadata from ERC.

Returns:

MetaData: A MetaData object containing station information for ERC.

aixweather.imports.ERC.load_credentials_ERC_weather_data() tuple[source]

GUI to return the username and password needed to access ERC weather data.

Returns:

tuple: The username and password required for accessing ERC weather data.

aixweather.imports.TRY module

import DWD TRY data

aixweather.imports.TRY.load_try_from_file(path: str) DataFrame[source]

Import data from a TRY file and convert it into a DataFrame.

Args:

path (str): The absolute path to the TRY file.

Returns:

pd.DataFrame: A DataFrame containing the imported data from the TRY file.

aixweather.imports.TRY.load_try_meta_from_file(path: str) MetaData[source]

Load a TRY file from a specified path and parse the header for metadata.

Args:

path (str): The file path to the TRY file to be loaded.

Returns:

MetaData: An object containing the parsed metadata from the TRY file.

aixweather.imports.custom_file module

change this file to your custom requirements (only import and perform as little preprocessing as possible)

aixweather.imports.custom_file.load_custom_from_file(path)[source]

Import data from file and convert them into df

Args:

path: absolute path to file

Returns:

pd.Dataframe: as raw as possible

aixweather.imports.custom_file.load_custom_meta_data()[source]

define or load your meta data here

aixweather.imports.utils_import module

includes a class that reads metadata from weather station

class aixweather.imports.utils_import.MetaData(**kwargs: str)[source]

Bases: object

A class for storing metadata information about a weather station.

Attributes:

station_name (str): The name of the weather station. station_id (str): The ID (DWD or DWD MOSMIX ID) of the weather station. altitude (float): The altitude of the weather station in meters. latitude (float): The latitude of the weather station in degree. longitude (float): The longitude of the weather station in degree. input_source (str): The source of input data for the station.

property altitude: float
property latitude: float
property longitude: float
property station_name