Build load profiles
Functions for the rules to build the hourly heat and load demand profiles - electricity load profiles are based on scaling an hourly base year profile to yearly future projections - daily heating demand is based on the degree day approx (from atlite) & upscaled hourly based on an intraday profile (for Denmark by default, see snakefile)
build_daily_heat_demand_profiles(cutout, pop_map, heat_demand_config, atlite_heating_hr_shift, switch_month_day=True)
Build the heat demand profile according to forecast demands
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutout
|
Cutout
|
the weather cutout object |
required |
pop_map
|
DataFrame
|
the population raster map |
required |
heat_demand_config
|
dict
|
the heat demand configuration |
required |
atlite_heating_hr_shift
|
int
|
the hour shift for heating demand, needed due to imperfect timezone handling in atlite |
required |
switch_month_day
|
bool
|
whether to switch month & day from heat_demand_config. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: regional daily heating demand with April to Sept forced to 0 |
Source code in workflow/scripts/build_load_profiles.py
build_heat_demand_profile(daily_hd, hot_water_per_day, snapshots, intraday_profiles, planning_horizons)
Downscale the daily heat demand to hourly heat demand using pre-defined intraday profiles
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
daily_hd
|
DataFrame
|
the day resolved heat demand for each region (atlite time axis) |
required |
hot_water_per_day
|
DataFrame
|
the day resolved hot water demand for each region |
required |
snapshots
|
date_range
|
the snapshots for the planning year |
required |
planning_horizons
|
int | str
|
the planning year |
required |
Returns:
| Type | Description |
|---|---|
tuple[DataFrame, DataFrame]
|
tuple[pd.DataFrame, pd.DataFrame]: space_heat_demand, domestic hot water demand |
Source code in workflow/scripts/build_load_profiles.py
downscale_by_pop(total, population)
simple downscale by population
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total
|
Series
|
the value to downsacale |
required |
population
|
Series
|
population by node |
required |
Returns:
| Type | Description |
|---|---|
Series
|
pd.Series: downscaled to nodal resolution by population |
Source code in workflow/scripts/build_load_profiles.py
downscale_time_data(dt_index, weekly_profile, regional_tzs)
Make hourly resolved data profiles based on exogenous weekdays and weekend profiles. This fn takes into account that the profiles are in local time and that regions may have different timezones.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt_index
|
DatetimeIndex
|
the snapshots (in network local naive time) but hourly res. |
required |
weekly_profile
|
Iterable
|
the weekly profile as a list of 7*24 entries. |
required |
regional_tzs
|
Series
|
regional geographical timezones for profiles. Defaults to pd.Series(index=PROV_NAMES, data=list(REGIONAL_GEO_TIMEZONES.values())). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: Regionally resolved profiles for each snapshot hour rperesented by dt_index |
Source code in workflow/scripts/build_load_profiles.py
prepare_hourly_load_data(hourly_load_p, prov_codes_p)
Read the hourly electricity demand data and prepare it for use in the model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hourly_load_p
|
PathLike
|
raw elec data from zenodo, see readme in data. |
required |
prov_codes_p
|
PathLike
|
province mapping for data. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: the hourly demand data with the right province names, in TWh/hr |
Source code in workflow/scripts/build_load_profiles.py
project_elec_demand(hourly_demand_base_yr_MWh, yearly_projections_MWh, year=2020)
Project the hourly demand to the future years
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hourly_demand_base_yr_MWh
|
DataFrame
|
the hourly demand in the base year |
required |
yearly_projections_MWh
|
DataFrame
|
the yearly projections |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: the projected hourly demand |
Source code in workflow/scripts/build_load_profiles.py
project_heat_demand(planning_year, projection_name, ref_year=REF_YEAR)
Make projections for heating demand
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
projection_name
|
str
|
name of projection |
required |
planning_year
|
int
|
year to project to |
required |
ref_year
|
int
|
reference year. Defaults to REF_YEAR. |
REF_YEAR
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
scaling factor relative to base year for heating demand |
Source code in workflow/scripts/build_load_profiles.py
scale_degree_day_to_reference(heating_dd, reg_yrly_tot)
Scale the heating degree days to the reference region
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heating_dd
|
Series
|
the heating degree days for each region (atlite) |
required |
reg_yrly_tot
|
DataFrame
|
the reference data per region |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.Series: the scaled heating degree days |