add option to specify deviating norm year for hydro

This commit is contained in:
Fabian Neumann 2022-06-15 14:00:47 +02:00
parent 4a44c45ace
commit 91ca07d72f
2 changed files with 7 additions and 2 deletions

View File

@ -169,6 +169,7 @@ renewable:
PHS_max_hours: 6
hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country, estimate_by_large_installations or a float
clip_min_inflow: 1.0
norm_year: 2013
lines:
types:

View File

@ -84,8 +84,12 @@ if __name__ == "__main__":
eia_stats = vhydro.get_eia_annual_hydro_generation(snakemake.input.eia_hydro_generation).reindex(columns=countries)
if len(year) > 0 and year not in eia_stats.index:
eia_stats.loc[year] = eia_stats.mean()
weather_year = snakemake.wildcards.weather_year
norm_year = snakemake.config['renewable']['hydro'].get('norm_year')
if norm_year:
eia_stats.loc[weather_year] = eia_stats.loc[norm_year]
elif weather_year and weather_year not in eia_stats.index:
eia_stats.loc[weather_year] = eia_stats.median()
inflow = cutout.runoff(shapes=country_shapes,
smooth=True,