acept.temperature_profiles

Module for building ambient temperature profiles

The temperature profiles are created using the DWD TRY data or the PVGIS TMY weather data. Each temperature profile contains the hourly temperature values in degrees Celsius for the whole year. Typically, these are measurements of the air temperature of two meters above the ground.

The temperature profiles are saved in a temporary directory in the acept.acept_constants.TEMP_PATH directory as a CSV file. Since the temperature profiles are used in ACEPT to calculate demand profiles with UrbanHeatPro (UHP), the profiles are saved in the expected input format for UHP.

Use this module to:
  • Create a temperature profile for the selected area

  • Create a temperature profile for the selected area for a single year

  • Create a temperature profile for the TMY for the center of the selected area

  • Create a temperature profile for the selected area for multiple years

Use the acept.temperature_profiles.build_temperature_profile_for_year() function to build a temperature profile for a single year. This function builds temperature profiles based on the available weather data (DWD TRY or TMY) for the selected area.

Module Contents

Functions

build_temperature_profiles_for_selected_years(→ str)

Creates a temperature profile for the selected year and the selected PLZ or Region using DWD TRY temperature data.

build_temperature_profiles_for_selected_years_with_combined_data(→ str)

Creates a temperature profile for the selected year and the selected PLZ or Region using the combined DWD TRY data.

build_temperature_profile_for_selected_year_with_combined_data(→ str)

Creates a temperature profile for the selected year and the selected PLZ or Region using the combined DWD TRY data.

build_temperature_profile_for_year(→ str)

Creates a temperature profile for the selected year and the selected PLZ or Region.

build_temperature_profile_for_tmy_for_shape(→ str)

Creates a temperature profile for the TMY for the center of the selected PLZ or Region, using the PVGIS API.

acept.temperature_profiles.build_temperature_profiles_for_selected_years(plz_or_region: int | str, selected_shape: geopandas.GeoDataFrame, year_start: int = DWD_MIN_YEAR, year_end: int = DWD_MAX_YEAR, debug: bool = True) str[source]

Creates a temperature profile for the selected year and the selected PLZ or Region using DWD TRY temperature data.

Parameters:
  • plz_or_region (int | str) – PLZ or Region for which the temperature profile should be created (area ID).

  • selected_shape (geopandas.GeoDataFrame) – GeoDataFrame of the selected area.

  • year_start (int) – First year for which the temperature profile should be created. Defaults to 1995.

  • year_end (int) – Last year for which the temperature profile should be created. Defaults to 2012.

  • debug (bool) – If True, print debug information.

Raises:

ValueOutsideRangeError – if year_start or year_end is outside the allowed range (1995-2012).

Returns:

Path to the directory where the created CSV files are stored.

Return type:

str

acept.temperature_profiles.build_temperature_profiles_for_selected_years_with_combined_data(plz_or_region: str | int, selected_shape: geopandas.GeoDataFrame, year_start: int = DWD_MIN_YEAR, year_end: int = DWD_MAX_YEAR, uncompressed: bool = False, debug: bool = True) str[source]

Creates a temperature profile for the selected year and the selected PLZ or Region using the combined DWD TRY data.

Parameters:
  • plz_or_region (str | int) – PLZ or Region for which the temperature profile should be created (area ID).

  • selected_shape (geopandas.GeoDataFrame) – GeoDataFrame of the selected area.

  • year_start (int) – First year for which the temperature profile should be created. Defaults to 1995.

  • year_end (int) – Last year for which the temperature profile should be created. Defaults to 2012.

  • uncompressed (bool) – If True, use the uncompressed DWD TRY data.

  • debug (bool) – If True, print debug information.

Raises:

ValueOutsideRangeError – If year_start or year_end is outside the allowed range (1995-2012).

Returns:

Path to the directory where the created CSV files are stored.

Return type:

str

acept.temperature_profiles.build_temperature_profile_for_selected_year_with_combined_data(plz_or_region: str | int, selected_shape: geopandas.GeoDataFrame, year: int = 2011, uncompressed: bool = False, debug: bool = True) str[source]

Creates a temperature profile for the selected year and the selected PLZ or Region using the combined DWD TRY data.

Parameters:
  • plz_or_region (str | int) – PLZ or Region for which the temperature profile should be created (area ID).

  • selected_shape (geopandas.GeoDataFrame) – GeoDataFrame of the selected area.

  • year (int) – Year for which the temperature profile should be created.

  • uncompressed (bool) – If True, use the uncompressed DWD TRY data.

  • debug (bool) – If True, print debug information.

Returns:

Path to the created CSV file.

Return type:

str

acept.temperature_profiles.build_temperature_profile_for_year(plz_or_region: str | int, selected_shape: geopandas.GeoDataFrame, year: int | None, debug: bool = True) str[source]

Creates a temperature profile for the selected year and the selected PLZ or Region.

If the selected year is None or no DWD TRY data is available, this function uses the TMY data from the PVGIS API.

Parameters:
  • plz_or_region (str | int) – PLZ or Region for which the temperature profile should be created (area ID).

  • selected_shape (geopandas.GeoDataFrame) – GeoDataFrame of the selected area.

  • year (int | None) – Year for which the temperature profile should be created. If None, uses the TMY data from the PVGIS API.

  • debug (bool) – If True, print debug information.

Returns:

Path to the created CSV file.

Return type:

str

acept.temperature_profiles.build_temperature_profile_for_tmy_for_shape(plz_or_region: str | int, selected_shape: geopandas.GeoDataFrame, debug: bool = True) str[source]

Creates a temperature profile for the TMY for the center of the selected PLZ or Region, using the PVGIS API.

Parameters:
  • plz_or_region (str | int) – PLZ or Region for which the temperature profile should be created (area ID).

  • selected_shape (geopandas.GeoDataFrame) – GeoDataFrame of the selected area.

  • debug (bool) – If True, print debug information.

Returns:

Path to the created CSV file.

Return type:

str