pypsa-eur/scripts/build_industrial_demand.py
Tom Brown 5157041ee2 Update for compatibility with latest PyPSA-eur master branch
Remove non-renewable generator and storage units from electricity-only
base network, since they're added differently here with links.

Remove unncessary cruft from config.yaml which is not used by
PyPSA-Eur-Sec (e.g. renewable configuration parameters).

Rename "naptha" to correct "naphtha".
2019-04-18 15:23:37 +02:00

36 lines
1.2 KiB
Python

import pandas as pd
idx = pd.IndexSlice
def build_industrial_demand():
population = pd.read_csv(snakemake.input.clustered_pop_layout,
index_col=0)
totals = pd.Series(data=[1100.,1814.,586.,400.,580.,186.],
index=["industry new electricity","industry process heat",
"naphtha feedstock","shipping H2","aviation kerosene","process emissions"])
industrial_demand = pd.DataFrame({i : population["total"]*totals[i]*1e6/population["total"].sum() for i in totals.index })
industrial_demand.to_csv(snakemake.output.industrial_demand)
if __name__ == "__main__":
# Detect running outside of snakemake and mock snakemake for testing
if 'snakemake' not in globals():
from vresutils import Dict
import yaml
snakemake = Dict()
snakemake.input = Dict()
snakemake.input['clustered_pop_layout'] = "resources/pop_layout_elec_s_128.csv"
snakemake.output = Dict()
snakemake.output['industrial_demand'] = "resources/industrial_demand_elec_s_128.csv"
with open('config.yaml') as f:
snakemake.config = yaml.load(f)
build_industrial_demand()