Skip to content

Commit

Permalink
inluded espeni dataset for demand
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFrankenQ committed Oct 11, 2023
1 parent c30d37b commit 23e44df
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 229 deletions.
18 changes: 12 additions & 6 deletions rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ if config["enable"].get("prepare_links_p_nom", False):


rule build_electricity_demand_europe:
params:
snapshots=config["snapshots"],
countries=config["countries"],
load=config["load"],
input:
ancient("data/load_raw.csv"),
output:
RESOURCES + "default_load.csv",
# RESOURCES + "default_load.csv",
RESOURCES + "load.csv",
log:
LOGS + "build_electricity_demand.log",
resources:
Expand Down Expand Up @@ -220,6 +225,7 @@ rule build_biomass_potentials:
"../scripts/build_biomass_potentials.py"


"""
rule build_2022_octopus_demand:
input:
default_load=RESOURCES + "default_load.csv",
Expand All @@ -234,6 +240,7 @@ rule build_2022_octopus_demand:
"../envs/environment.yaml"
script:
"../scripts/build_2022_octopus_demand.py"
"""


rule build_powerplants:
Expand Down Expand Up @@ -604,14 +611,12 @@ rule add_extra_components:
rule build_electricity_demand_gb:
params:
snapshots=config["snapshots"]
input:
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_eso.geojson",
output:
electricity_demand_gb=RESOURCES + "electricity_demand_gb_s{simpl}_eso.csv",
espeni_electricity_demand=RESOURCES + "ESPENI_demand_gb.csv",
log:
LOGS + "build_electricity_demand_gb_s{simpl}.log",
LOGS + "build_electricity_demand_gb.log",
benchmark:
BENCHMARKS + "build_electricity_demand_gb/s{simpl}"
BENCHMARKS + "build_electricity_demand_gb"
threads: 1
resources:
mem_mb=2000,
Expand All @@ -626,6 +631,7 @@ rule prepare_network:
input:
RESOURCES + "networks/elec_s{simpl}_eso_ec.nc",
overrides="data/override_component_attrs",
espeni_electricity_demand=RESOURCES + "ESPENI_demand_gb.csv",
tech_costs=COSTS,
biomass_potentials=RESOURCES + "biomass_potentials_s{simpl}_eso.csv",
capacity_constraints=RESOURCES + "fes_capacity_constraints_{fes}_{year}.csv",
Expand Down
6 changes: 5 additions & 1 deletion rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
rule retrieve_electricity_demand:
input:
HTTP.remote(
"data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv",
"data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv".format(
version="2019-06-05"
if config["snapshots"]["end"] < "2019"
else "2020-10-06"
),
keep_local=True,
static=True,
),
Expand Down
24 changes: 24 additions & 0 deletions scripts/_fes_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,27 @@ def get_import_export_balance(scenario, year):
df.columns = range(2022, 2052)

return df.loc[scenario_mapper[scenario], int(year)] * 1e6


def get_electric_heat_demand(scenario, year, base_year=2019):
"""Electricity load in GB meeting heat demand"""

col = string.ascii_uppercase.index("M")

df = (
pd.read_excel(data_file,
sheet_name="EC.06",
header=7,
index_col=0,
usecols=[col+i for i in range(47)],
)
).iloc[:5]

df.columns = pd.Series(df.columns).apply(lambda dt: dt.year)

# The share of demand subsumed by the general electricity demand
base_demand = df.loc["History", int(base_year)]

# future demand
future_demand = df.loc[scenario_mapper[scenario], int(year)]
return base_demand * 1e6, future_demand * 1e6
190 changes: 0 additions & 190 deletions scripts/build_2022_octopus_demand.py

This file was deleted.

Loading

0 comments on commit 23e44df

Please sign in to comment.