industry: build nodal energy demand from nodal production
This commit is contained in:
parent
f0937e203b
commit
f2b347334d
11
Snakefile
11
Snakefile
@ -226,6 +226,17 @@ rule build_industrial_production_per_node:
|
|||||||
script: 'scripts/build_industrial_production_per_node.py'
|
script: 'scripts/build_industrial_production_per_node.py'
|
||||||
|
|
||||||
|
|
||||||
|
rule build_industrial_energy_demand_per_node:
|
||||||
|
input:
|
||||||
|
industry_sector_ratios="resources/industry_sector_ratios.csv",
|
||||||
|
industrial_production_per_node="resources/industrial_production_{network}_s{simpl}_{clusters}.csv"
|
||||||
|
output:
|
||||||
|
industrial_energy_demand_per_node="resources/industrial_energy_demand_{network}_s{simpl}_{clusters}.csv"
|
||||||
|
threads: 1
|
||||||
|
resources: mem_mb=1000
|
||||||
|
script: 'scripts/build_industrial_energy_demand_per_node.py'
|
||||||
|
|
||||||
|
|
||||||
rule build_industrial_energy_demand_per_country_today:
|
rule build_industrial_energy_demand_per_country_today:
|
||||||
input:
|
input:
|
||||||
ammonia_production="resources/ammonia_production.csv",
|
ammonia_production="resources/ammonia_production.csv",
|
||||||
|
26
scripts/build_industrial_energy_demand_per_node.py
Normal file
26
scripts/build_industrial_energy_demand_per_node.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
# import EU ratios df as csv
|
||||||
|
industry_sector_ratios=pd.read_csv(snakemake.input.industry_sector_ratios,
|
||||||
|
index_col=0)
|
||||||
|
|
||||||
|
#material demand per node and industry (kton/a)
|
||||||
|
nodal_production = pd.read_csv(snakemake.input.industrial_production_per_node, index_col=0)
|
||||||
|
|
||||||
|
#final energy consumption per node and industry (TWh/a)
|
||||||
|
nodal_df = nodal_production.dot(industry_sector_ratios.T)
|
||||||
|
nodal_df*= 0.001 #GWh -> TWh (ktCO2 -> MtCO2)
|
||||||
|
|
||||||
|
|
||||||
|
rename_sectors = {'elec':'electricity',
|
||||||
|
'biomass':'solid biomass',
|
||||||
|
'heat':'low-temperature heat'}
|
||||||
|
|
||||||
|
nodal_df.rename(columns=rename_sectors,inplace=True)
|
||||||
|
|
||||||
|
nodal_df.index.name = "TWh/a (MtCO2/a)"
|
||||||
|
|
||||||
|
nodal_df.to_csv(snakemake.output.industrial_energy_demand_per_node,
|
||||||
|
float_format='%.2f')
|
Loading…
Reference in New Issue
Block a user