From f70e0304e57ee7b5013b6bd8e63d54c9cbbd80ad Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Wed, 16 Jan 2019 12:08:46 +0100 Subject: [PATCH] Fix plotting settings --- Snakefile | 4 ++-- config.yaml | 6 +++++- scripts/plot_network.py | 6 +++--- scripts/plot_summary.py | 6 +++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Snakefile b/Snakefile index f479e923..b4d86ec9 100644 --- a/Snakefile +++ b/Snakefile @@ -266,8 +266,8 @@ rule make_summary: script: "scripts/make_summary.py" rule plot_summary: - input: directory("results/summaries/{network}_s{simpl}_{clusters}_lv{lv}_{opts}") - output: "results/plots/summary_{summary}_{network}_s{simpl}_{clusters}_lv{lv}_{opts}.{ext}" + input: "results/summaries/{network}_s{simpl}_{clusters}_lv{lv}_{opts}_{country}" + output: "results/plots/summary_{summary}_{network}_s{simpl}_{clusters}_lv{lv}_{opts}_{country}.{ext}" script: "scripts/plot_summary.py" # Local Variables: diff --git a/config.yaml b/config.yaml index fedff423..06cbff03 100644 --- a/config.yaml +++ b/config.yaml @@ -206,7 +206,7 @@ plotting: energy_threshold: 50. - vre_techs: ["onwind", "offwind", "solar", "ror"] + vre_techs: ["onwind", "offwind-ac", "offwind-dc", "solar", "ror"] conv_techs: ["OCGT", "CCGT", "Nuclear", "Coal"] storage_techs: ["hydro+PHS", "battery", "H2"] # store_techs: ["Li ion", "water tanks"] @@ -221,7 +221,11 @@ plotting: "onwind" : "b" "onshore wind" : "b" 'offwind' : "c" + 'offwind-ac' : "c" + 'offwind-dc' : "aquamarine" 'offshore wind' : "c" + 'offshore wind ac' : "c" + 'offshore wind dc' : "aquamarine" "hydro" : "#3B5323" "hydro+PHS" : "#3B5323" "hydro reservoir" : "#3B5323" diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 7bcbf259..0330542d 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -187,7 +187,7 @@ fig.savefig(snakemake.output.only_map, dpi=150, ax1 = ax = fig.add_axes([-0.115, 0.625, 0.2, 0.2]) ax.set_title('Energy per technology', fontdict=dict(fontsize="medium")) -e_primary = aggregate_p(n).drop('load').loc[lambda s: s>0] +e_primary = aggregate_p(n).drop('load', errors='ignore').loc[lambda s: s>0] patches, texts, autotexts = ax.pie(e_primary, startangle=90, @@ -214,8 +214,8 @@ def split_costs(n): costs, costs_cap_ex, costs_cap_new, costs_marg = split_costs(n) -costs_graph = pd.DataFrame(dict(a=costs.drop('load')), - index=['AC-AC', 'AC line', 'onwind', 'offwind', 'solar', 'OCGT', 'battery', 'H2']).dropna() +costs_graph = pd.DataFrame(dict(a=costs.drop('load', errors='ignore')), + index=['AC-AC', 'AC line', 'onwind', 'offwind-ac', 'offwind-dc', 'solar', 'OCGT', 'battery', 'H2']).dropna() bottom = np.array([0., 0.]) texts = [] diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py index de2f0c24..2a149a4c 100644 --- a/scripts/plot_summary.py +++ b/scripts/plot_summary.py @@ -31,6 +31,10 @@ def rename_techs(label): label = "methanation" elif label == "offwind": label = "offshore wind" + elif label == "offwind-ac": + label = "offshore wind ac" + elif label == "offwind-dc": + label = "offshore wind dc" elif label == "onwind": label = "onshore wind" elif label == "ror": @@ -47,7 +51,7 @@ def rename_techs(label): return label -preferred_order = pd.Index(["transmission lines","hydroelectricity","hydro reservoir","run of river","pumped hydro storage","onshore wind","offshore wind","solar PV","solar thermal","building retrofitting","ground heat pump","air heat pump","resistive heater","CHP","OCGT","gas boiler","gas","natural gas","methanation","hydrogen storage","battery storage","hot water storage"]) +preferred_order = pd.Index(["transmission lines","hydroelectricity","hydro reservoir","run of river","pumped hydro storage","onshore wind","offshore wind ac", "offshore wind dc","solar PV","solar thermal","building retrofitting","ground heat pump","air heat pump","resistive heater","CHP","OCGT","gas boiler","gas","natural gas","methanation","hydrogen storage","battery storage","hot water storage"]) def plot_costs(infn, fn=None):