update ammonia demand data to 2022
This commit is contained in:
parent
aa820fa046
commit
2f3fde26d0
@ -437,7 +437,7 @@ rule build_salt_cavern_potentials:
|
|||||||
|
|
||||||
rule build_ammonia_production:
|
rule build_ammonia_production:
|
||||||
input:
|
input:
|
||||||
usgs="data/bundle/myb1-2021-nitro-ert.xlsx",
|
usgs="data/bundle/myb1-2022-nitro-ert.xlsx",
|
||||||
output:
|
output:
|
||||||
ammonia_production=resources("ammonia_production.csv"),
|
ammonia_production=resources("ammonia_production.csv"),
|
||||||
threads: 1
|
threads: 1
|
||||||
|
@ -67,7 +67,7 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle",
|
|||||||
|
|
||||||
rule retrieve_ammonia_demand:
|
rule retrieve_ammonia_demand:
|
||||||
output:
|
output:
|
||||||
"data/bundle/myb1-2021-nitro-ert.xlsx",
|
"data/bundle/myb1-2022-nitro-ert.xlsx",
|
||||||
log:
|
log:
|
||||||
"logs/retrieve_ammonia_demand.log",
|
"logs/retrieve_ammonia_demand.log",
|
||||||
retries: 2
|
retries: 2
|
||||||
|
@ -43,13 +43,13 @@ if __name__ == "__main__":
|
|||||||
skiprows=5,
|
skiprows=5,
|
||||||
header=0,
|
header=0,
|
||||||
index_col=0,
|
index_col=0,
|
||||||
skipfooter=19,
|
skipfooter=7,
|
||||||
na_values=["--"],
|
na_values=["--"],
|
||||||
)
|
)
|
||||||
|
|
||||||
ammonia.index = cc.convert(ammonia.index, to="iso2")
|
ammonia.index = cc.convert(ammonia.index, to="iso2")
|
||||||
|
|
||||||
years = [str(i) for i in range(2017, 2022)]
|
years = [str(i) for i in range(2018, 2023)]
|
||||||
|
|
||||||
ammonia = ammonia.rename(columns=lambda x: str(x))[years]
|
ammonia = ammonia.rename(columns=lambda x: str(x))[years]
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ def separate_basic_chemicals(demand, year):
|
|||||||
|
|
||||||
demand["Ammonia"] = 0.0
|
demand["Ammonia"] = 0.0
|
||||||
|
|
||||||
year_to_use = min(max(year, 2017), 2021)
|
year_to_use = min(max(year, 2018), 2022)
|
||||||
if year_to_use != year:
|
if year_to_use != year:
|
||||||
logger.info(f"Using data from {year_to_use} for ammonia production.")
|
logger.info(f"Using data from {year_to_use} for ammonia production.")
|
||||||
demand.loc[there, "Ammonia"] = ammonia.loc[there, str(year_to_use)]
|
demand.loc[there, "Ammonia"] = ammonia.loc[there, str(year_to_use)]
|
||||||
|
Loading…
Reference in New Issue
Block a user