change industry reference year to 2019

This commit is contained in:
lisazeyen 2024-07-29 16:00:37 +02:00
parent 314f6c6f0f
commit aa820fa046
2 changed files with 7 additions and 3 deletions

View File

@ -716,7 +716,7 @@ industry:
MWh_CH4_per_tMeOH: 10.25
MWh_MeOH_per_tMeOH: 5.528
hotmaps_locate_missing: false
reference_year: 2021
reference_year: 2019
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#costs

View File

@ -293,6 +293,7 @@ def separate_basic_chemicals(demand, year):
"""
Separate basic chemicals into ammonia, chlorine, methanol and HVC.
"""
# ammonia data from 2017-2021
ammonia = pd.read_csv(snakemake.input.ammonia_production, index_col=0)
there = ammonia.index.intersection(demand.index)
@ -302,7 +303,10 @@ def separate_basic_chemicals(demand, year):
demand["Ammonia"] = 0.0
demand.loc[there, "Ammonia"] = ammonia.loc[there, str(year)]
year_to_use = min(max(year, 2017), 2021)
if year_to_use != year:
logger.info(f"Using data from {year_to_use} for ammonia production.")
demand.loc[there, "Ammonia"] = ammonia.loc[there, str(year_to_use)]
demand["Basic chemicals"] -= demand["Ammonia"]