modify to run without GEBCO and without hydro

This commit is contained in:
Fabian Neumann 2019-10-03 12:32:49 +02:00
parent e44c5491af
commit 5ea60a1ee0
3 changed files with 22 additions and 15 deletions

View File

@ -93,7 +93,7 @@ rule build_bus_regions:
script: "scripts/build_bus_regions.py" script: "scripts/build_bus_regions.py"
rule build_cutout: rule build_cutout:
output: "cutouts/{cutout}" output: directory("cutouts/{cutout}")
resources: mem=config['atlite'].get('nprocesses', 4) * 1000 resources: mem=config['atlite'].get('nprocesses', 4) * 1000
threads: config['atlite'].get('nprocesses', 4) threads: config['atlite'].get('nprocesses', 4)
benchmark: "benchmarks/build_cutout_{cutout}" benchmark: "benchmarks/build_cutout_{cutout}"
@ -110,7 +110,9 @@ rule build_renewable_profiles:
base_network="networks/base.nc", base_network="networks/base.nc",
corine="data/bundle/corine/g250_clc06_V18_5.tif", corine="data/bundle/corine/g250_clc06_V18_5.tif",
natura="resources/natura.tiff", natura="resources/natura.tiff",
gebco="data/bundle/GEBCO_2014_2D.nc", gebco=lambda wildcards: ("data/bundle/GEBCO_2014_2D.nc"
if "max_depth" in config["renewable"][wildcards.technology].keys()
else []),
country_shapes='resources/country_shapes.geojson', country_shapes='resources/country_shapes.geojson',
offshore_shapes='resources/offshore_shapes.geojson', offshore_shapes='resources/offshore_shapes.geojson',
regions=lambda wildcards: ("resources/regions_onshore.geojson" regions=lambda wildcards: ("resources/regions_onshore.geojson"
@ -124,6 +126,7 @@ rule build_renewable_profiles:
# group: 'feedin_preparation' # group: 'feedin_preparation'
script: "scripts/build_renewable_profiles.py" script: "scripts/build_renewable_profiles.py"
if 'hydro' in config['renewable'].keys():
rule build_hydro_profile: rule build_hydro_profile:
input: input:
country_shapes='resources/country_shapes.geojson', country_shapes='resources/country_shapes.geojson',
@ -305,7 +308,9 @@ rule build_country_flh:
base_network="networks/base.nc", base_network="networks/base.nc",
corine="data/bundle/corine/g250_clc06_V18_5.tif", corine="data/bundle/corine/g250_clc06_V18_5.tif",
natura="resources/natura.tiff", natura="resources/natura.tiff",
gebco="data/bundle/GEBCO_2014_2D.nc", gebco=lambda wildcards: ("data/bundle/GEBCO_2014_2D.nc"
if "max_depth" in config["renewable"][wildcards.technology].keys()
else []),
country_shapes='resources/country_shapes.geojson', country_shapes='resources/country_shapes.geojson',
offshore_shapes='resources/offshore_shapes.geojson', offshore_shapes='resources/offshore_shapes.geojson',
pietzker="data/pietzker2014.xlsx", pietzker="data/pietzker2014.xlsx",

View File

@ -600,6 +600,7 @@ if __name__ == "__main__":
attach_conventional_generators(n, costs, ppl) attach_conventional_generators(n, costs, ppl)
attach_wind_and_solar(n, costs) attach_wind_and_solar(n, costs)
if 'hydro' in snakemake.config['renewable']:
attach_hydro(n, costs, ppl) attach_hydro(n, costs, ppl)
attach_extendable_generators(n, costs, ppl) attach_extendable_generators(n, costs, ppl)
attach_storage(n, costs) attach_storage(n, costs)

View File

@ -184,6 +184,7 @@ def init_globals(bounds_xXyY, n_dx, n_dy, n_config, n_paths):
config = n_config config = n_config
paths = n_paths paths = n_paths
if "max_depth" in config:
gebco = gk.raster.loadRaster(paths["gebco"]) gebco = gk.raster.loadRaster(paths["gebco"])
gebco.SetProjection(gk.srs.loadSRS(4326).ExportToWkt()) gebco.SetProjection(gk.srs.loadSRS(4326).ExportToWkt())