From 4ec95fa90e972afa1c613dbf6595303c37d3e588 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 20 Jul 2022 13:01:14 +0200 Subject: [PATCH 1/2] hydro: distribute eia data for former countries to successor states by ratio --- scripts/build_hydro_profile.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py index 4add4c85..eed3431e 100644 --- a/scripts/build_hydro_profile.py +++ b/scripts/build_hydro_profile.py @@ -76,10 +76,32 @@ def get_eia_annual_hydro_generation(fn, countries): df = pd.read_csv(fn, skiprows=2, index_col=1, na_values=[u' ','--']).iloc[1:, 1:] df.index = df.index.str.strip() + former_countries = { + "Former Czechoslovakia": dict( + countries=["Czech Republic", "Slovakia"], + start=1980, end=1992), + "Former Serbia and Montenegro": dict( + countries=["Serbia", "Montenegro"], + start=1992, end=2005), + "Former Yugoslavia": dict( + countries=["Slovenia", "Croatia", "Bosnia and Herzegovina", "Serbia", "Montenegro", "North Macedonia"], + start=1980, end=1991), + } + + for k, v in former_countries.items(): + period = [str(i) for i in range(v["start"], v["end"]+1)] + ratio = df.loc[v['countries']].T.dropna().sum() + ratio /= ratio.sum() + for country in v['countries']: + df.loc[country, period] = df.loc[k, period] * ratio[country] + + baltic_states = ["Latvia", "Estonia", "Lithuania"] + df.loc[baltic_states] = df.loc[baltic_states].T.fillna(df.loc[baltic_states].mean(axis=1)).T + df.loc["Germany"] = df.filter(like='Germany', axis=0).sum() - df.loc["Serbia"] += df.loc["Kosovo"] + df.loc["Serbia"] += df.loc["Kosovo"].fillna(0.) df = df.loc[~df.index.str.contains('Former')] - df.drop(["Europe", "Germany, West", "Germany, East"], inplace=True) + df.drop(["Europe", "Germany, West", "Germany, East", "Kosovo"], inplace=True) df.index = cc.convert(df.index, to='iso2') df.index.name = 'countries' From 3210bbf8f92e114811635d09f223a73a1266b6c2 Mon Sep 17 00:00:00 2001 From: Max Parzen Date: Thu, 21 Jul 2022 14:43:28 +0100 Subject: [PATCH 2/2] clean config, add H2 pipeline comment --- config.default.yaml | 2 +- config.tutorial.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index d185b5d1..9caf7ad4 100755 --- a/config.default.yaml +++ b/config.default.yaml @@ -52,7 +52,7 @@ electricity: Generator: [solar, onwind, offwind-ac, offwind-dc, OCGT] StorageUnit: [] # battery, H2 Store: [battery, H2] - Link: [AC, DC] + Link: [] # H2 pipeline # use pandas query strings here, e.g. Country not in ['Germany'] powerplants_filter: (DateOut >= 2022 or DateOut != DateOut) diff --git a/config.tutorial.yaml b/config.tutorial.yaml index 00b8576a..61866772 100755 --- a/config.tutorial.yaml +++ b/config.tutorial.yaml @@ -40,7 +40,7 @@ electricity: Generator: [OCGT] StorageUnit: [] #battery, H2 Store: [battery, H2] - Link: [] + Link: [] # H2 pipeline max_hours: battery: 6