From 138d151c8b403999f4f81569e5c464a722a33e3e Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 28 Dec 2022 12:48:51 +0100 Subject: [PATCH] only compute solar thermal profiles if technology is included --- Snakefile | 6 +++--- scripts/prepare_sector_network.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Snakefile b/Snakefile index f22546ba..254b1cb1 100644 --- a/Snakefile +++ b/Snakefile @@ -500,9 +500,9 @@ rule prepare_sector_network: cop_air_total="resources/cop_air_total_elec_s{simpl}_{clusters}.nc", cop_air_rural="resources/cop_air_rural_elec_s{simpl}_{clusters}.nc", cop_air_urban="resources/cop_air_urban_elec_s{simpl}_{clusters}.nc", - solar_thermal_total="resources/solar_thermal_total_elec_s{simpl}_{clusters}.nc", - solar_thermal_urban="resources/solar_thermal_urban_elec_s{simpl}_{clusters}.nc", - solar_thermal_rural="resources/solar_thermal_rural_elec_s{simpl}_{clusters}.nc", + solar_thermal_total="resources/solar_thermal_total_elec_s{simpl}_{clusters}.nc" if config["sector"]["solar_thermal"] else [], + solar_thermal_urban="resources/solar_thermal_urban_elec_s{simpl}_{clusters}.nc" if config["sector"]["solar_thermal"] else [], + solar_thermal_rural="resources/solar_thermal_rural_elec_s{simpl}_{clusters}.nc" if config["sector"]["solar_thermal"] else [], **build_retro_cost_output, **build_biomass_transport_costs_output, **gas_infrastructure diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 560d624e..011eb97e 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1452,9 +1452,10 @@ def add_heat(n, costs): "ground": xr.open_dataarray(snakemake.input.cop_soil_total).to_pandas().reindex(index=n.snapshots) } - solar_thermal = xr.open_dataarray(snakemake.input.solar_thermal_total).to_pandas().reindex(index=n.snapshots) - # 1e3 converts from W/m^2 to MW/(1000m^2) = kW/m^2 - solar_thermal = options['solar_cf_correction'] * solar_thermal / 1e3 + if options["solar_thermal"]: + solar_thermal = xr.open_dataarray(snakemake.input.solar_thermal_total).to_pandas().reindex(index=n.snapshots) + # 1e3 converts from W/m^2 to MW/(1000m^2) = kW/m^2 + solar_thermal = options['solar_cf_correction'] * solar_thermal / 1e3 for name in heat_systems: