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(heat_demand_config, atlite_heating_hr_shift, switch_month_day=True)
Build the heat demand profile according to forecast demans
Parameters:
Name | Type | Description | Default |
---|---|---|---|
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, planning_horizons)
Downscale the daily heat demand to hourly heat demand using pre-defined intraday profiles THIS FUNCTION ALSO MAKES PROJECTIONS FOR HEATING DEMAND - WHICH IS NOT THE CORRECT PLACE
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, object, DataFrame]
|
tuple[pd.DataFrame, pd.DataFrame, object, pd.DataFrame]: heat, space_heat, space_heating_per_hdd, water_heat demands |
Source code in workflow/scripts/build_load_profiles.py
build_hot_water_per_day(planning_horizons)
Make projections for the hot water demand increase and scale the ref year value NB: the ref year value is for 2008 not 2020 -> incorrect
Parameters:
Name | Type | Description | Default |
---|---|---|---|
planning_horizons
|
int | str
|
the planning year to which demand will be projected |
required |
Raises:
Type | Description |
---|---|
ValueError
|
if the config projection type is not supported |
Returns:
Type | Description |
---|---|
Series
|
pd.Series: regional hot water demand per day |
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
make_heat_demand_projections(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
prepare_hourly_load_data(hourly_load_p, prov_codes_p)
Read the hourly 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 |