aixweather package

AixWeather-Module. See readme or documentation for more information.

Subpackages

Submodules

aixweather.data_quality_checks module

This module includes functions for analyzing and visualizing missing values.

aixweather.data_quality_checks.plot_heatmap_missing_values(df)[source]

Generate a heatmap to visualize missing values in a DataFrame.

Args:

df (pd.DataFrame): The DataFrame to be analyzed for missing values.

Returns:

plt: A Matplotlib figure representing the heatmap of missing values.

aixweather.data_quality_checks.print_df_info(df)[source]

prints df info for intermediate checks or debugging

aixweather.definitions module

This module includes variables or functions which define central variables for the whole project.

class aixweather.definitions.CoreDataFormat[source]

Bases: object

Information on core data: Time of measurement is always at the indicated time. Units as in TMY3 https://www.nrel.gov/docs/fy08osti/43156.pdf Only exception to TMY3 format is pressure, as all TMY3 data file actually use “Pa” instead of mbar

format: dict = {'Aerosol': {'unit': '1thousandth'}, 'AtmPressure': {'unit': 'Pa'}, 'CeilingH': {'unit': 'm'}, 'DewPointTemp': {'unit': 'degC'}, 'DiffHorRad': {'unit': 'Wh/m2'}, 'DiffuseHorIll': {'unit': 'lux'}, 'DirHorRad': {'unit': 'Wh/m2'}, 'DirNormRad': {'unit': 'Wh/m2'}, 'DirecNormIll': {'unit': 'lux'}, 'DryBulbTemp': {'unit': 'degC'}, 'ExtDirNormRad': {'unit': 'Wh/m2'}, 'ExtHorRad': {'unit': 'Wh/m2'}, 'GlobHorIll': {'unit': 'lux'}, 'GlobHorRad': {'unit': 'Wh/m2'}, 'HorInfra': {'unit': 'Wh/m2'}, 'LiquidPrecD': {'unit': 'mm/h'}, 'OpaqueSkyCover': {'unit': '1tenth'}, 'PrecWater': {'unit': 'mm'}, 'RelHum': {'unit': 'percent'}, 'Soil_Temperature_10cm': {'unit': 'degC'}, 'Soil_Temperature_1m': {'unit': 'degC'}, 'Soil_Temperature_20cm': {'unit': 'degC'}, 'Soil_Temperature_50cm': {'unit': 'degC'}, 'Soil_Temperature_5cm': {'unit': 'degC'}, 'TotalSkyCover': {'unit': '1tenth'}, 'Visibility': {'unit': 'km'}, 'WindDir': {'unit': 'deg'}, 'WindSpeed': {'unit': 'm/s'}, 'ZenithLum': {'unit': 'Cd/m2'}}
aixweather.definitions.result_folder_path() str[source]

Creates the path to the resultsfolder.

aixweather.definitions.results_file_path(filename: str, folder_path: str = None) str[source]

create a path to a results file

Args:

filename: name of file folder_path: path to result folder

Returns:

str: path to result file

aixweather.project_class module

This module contains the central project classes which are used by the user.

class aixweather.project_class.ProjectClassCustom(path, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing custom weather data. Modify this class and its functions to create your own weather data pipeline and consider to create a pull request to add the pipeline to the repository.

For common attributes, properties, and methods, refer to the base class.

Attributes:

path (str): The file path to the custom weather data.

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function

class aixweather.project_class.ProjectClassDWDForecast(station: str, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing weather forecast data from DWD (Deutscher Wetterdienst).

For common attributes, properties, and methods, refer to the base class.

Attributes:

station (str): The identifier of the KML grid associated with the forecast data.

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function

class aixweather.project_class.ProjectClassDWDHistorical(start: datetime, end: datetime, station: str, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing historical weather data from DWD (Deutscher Wetterdienst).

For common attributes, properties, and methods, refer to the base class.

Attributes:

station (str): The identifier of the DWD weather station associated with the data.

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function

class aixweather.project_class.ProjectClassEPW(path, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing weather data from EPW (EnergyPlus Weather) format.

For common attributes, properties, and methods, refer to the base class.

Attributes:

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

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function

class aixweather.project_class.ProjectClassERC(start: datetime, end: datetime, cred: tuple = None, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing weather data from the ERC (Energy Research Center).

For common attributes, properties, and methods, refer to the base class.

Attributes:

cred (tuple): A tuple containing credentials or authentication information for accessing the data source.

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function

class aixweather.project_class.ProjectClassGeneral(**kwargs)[source]

Bases: ABC

An abstract base class representing a general project.

For each source of weather data, a project class should inherit from this class and implement specific methods for data import and transformation.

Attributes:
fillna (bool): A flag indicating whether NaN values should be filled

in the output formats.

abs_result_folder_path (str): Optionally define the absolute path to

the desired export location.

start (pd.Timestamp or None): The start date of the project data in UTC

(sometimes inferred by the inheriting class).

end (pd.Timestamp or None): The end date of the project data in UTC.

Properties:

imported_data (pd.DataFrame): The imported weather data. core_data (pd.DataFrame): The weather data in a standardized core

format.

output_df_<outputformat> (pd.DataFrame): The output data frame

(name depends on output format).

meta_data: Metadata associated with weather data origin.

Methods:
import_data(): An abstract method to import data from the specific

source.

data_2_core_data(): An abstract method to transform imported data into

core data format.

core_2_mos(): Convert core data to MOS format. core_2_epw(): Convert core data to EPW format. core_2_csv(): Convert core data to CSV format. core_2_json(): Convert core data to JSON format. core_2_pickle(): Convert core data to Pickle format.

core_2_csv(filename: str = None) str[source]

Convert core data to .csv file

filename (str): Name of the file to be saved. The default is constructed

based on the station name.

Returns:

str: Path to the exported file.

core_2_epw(filename: str = None, export_in_utc: bool = False) str[source]

Convert core data to .epw file

filename (str): Name of the file to be saved. The default is constructed

based on the meta-data as well as start and stop time

export_in_utc (bool): Timezone to be used for the export.

True (default) to use the core_df timezone, UTC+0, False (default) to use timezone from metadata

Returns:

str: Path to the exported file.

core_2_json(filename: str = None) str[source]

Convert core data to .json file

filename (str): Name of the file to be saved. The default is constructed

based on the station name.

Returns:

str: Path to the exported file.

core_2_mos(filename: str = None, export_in_utc: bool = False) str[source]

Convert core data to .mos file

filename (str): Name of the file to be saved. The default is constructed

based on the meta-data as well as start and stop time

export_in_utc (bool): Timezone to be used for the export.

True (default) to use the core_df timezone, UTC+0, False (default) to use timezone from metadata

Returns:

str: Path to the exported file.

core_2_pickle(filename: str = None) str[source]

Convert core data pickle file

filename (str): Name of the file to be saved. The default is constructed

based on the station name.

Returns:

str: Path to the exported file.

property core_data

Get core data

abstract data_2_core_data()[source]

Abstract function to convert the imported data to core data.

abstract import_data()[source]

Abstract function to import weather data.

property imported_data

Get imported data

start_end_checks()[source]

Make sure start and end are of type datetime and end is after start.

class aixweather.project_class.ProjectClassTRY(path, **kwargs)[source]

Bases: ProjectClassGeneral

A class representing a project for importing and processing weather data from TRY (Test Reference Year) format.

For common attributes, properties, and methods, refer to the base class.

Attributes:

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

data_2_core_data()[source]

override abstract function

import_data()[source]

override abstract function