Skip to content

Commit

Permalink
Merge pull request #1101 from openego/fixes/#1096_german_ch4_stores
Browse files Browse the repository at this point in the history
Adjust German CH4 stores
  • Loading branch information
IlkaCu committed Jun 30, 2023
2 parents 0248510 + 72a9ea8 commit 733e9e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@ Bug Fixes
* Fix URL of TYNDP scenario dataset
* Automatically generated tasks now get unique :code:`task_id`\s.
Fixes issue `#985`_ via PR `#986`_.
* Adjust capcities of German CH4 stores
`#1096 <https://github.com/openego/eGon-data/issues/1096>`_
* Fix faulty DSM time series
`#1088 <https://github.com/openego/eGon-data/issues/1088>`_
* Set upper limit on commissioning date for units from MaStR
Expand Down
25 changes: 22 additions & 3 deletions src/egon/data/datasets/ch4_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CH4Storages(Dataset):
#:
name: str = "CH4Storages"
#:
version: str = "0.0.2"
version: str = "0.0.3"

def __init__(self, dependencies):
super().__init__(
Expand Down Expand Up @@ -88,7 +88,7 @@ def import_installed_ch4_storages(scn_name):
target_file,
delimiter=";",
decimal=".",
usecols=["lat", "long", "country_code", "param"],
usecols=["lat", "long", "country_code", "param", "method"],
)

Gas_storages_list = Gas_storages_list[
Expand All @@ -99,13 +99,18 @@ def import_installed_ch4_storages(scn_name):
max_workingGas_M_m3 = []
NUTS1 = []
end_year = []
method_cap = []
for index, row in Gas_storages_list.iterrows():
param = ast.literal_eval(row["param"])
NUTS1.append(param["nuts_id_1"])
end_year.append(param["end_year"])
max_workingGas_M_m3.append(param["max_workingGas_M_m3"])

Gas_storages_list = Gas_storages_list.assign(NUTS1=NUTS1)
method = ast.literal_eval(row["method"])
method_cap.append(method["max_workingGas_M_m3"])

Gas_storages_list["method_cap"] = method_cap
Gas_storages_list = Gas_storages_list.assign(NUTS1=NUTS1).drop_duplicates()

# Calculate e_nom
conv_factor = 10830 # gross calorific value = 39 MJ/m3 (eurogas.org)
Expand All @@ -114,6 +119,19 @@ def import_installed_ch4_storages(scn_name):
end_year = [float("inf") if x == None else x for x in end_year]
Gas_storages_list = Gas_storages_list.assign(end_year=end_year)

# Adjust the storage capacities calculated by 'Median(max_workingGas_M_m3)'
total_german_cap = 266424202 # MWh GIE https://www.gie.eu/transparency/databases/storage-database/
ch4_estimated = Gas_storages_list[
Gas_storages_list.method_cap == "Median(max_workingGas_M_m3)"
]
german_cap_source = Gas_storages_list[
Gas_storages_list.method_cap != "Median(max_workingGas_M_m3)"
].e_nom.sum()

Gas_storages_list.loc[ch4_estimated.index, "e_nom"] = (
total_german_cap - german_cap_source
) / len(ch4_estimated)

# Cut data to federal state if in testmode
boundary = settings()["egon-data"]["--dataset-boundary"]
if boundary != "Everything":
Expand Down Expand Up @@ -179,6 +197,7 @@ def import_installed_ch4_storages(scn_name):
"end_year",
"geom",
"bus_id",
"method_cap",
]
)

Expand Down

0 comments on commit 733e9e4

Please sign in to comment.