From ca183ba89ee65ebe6500c23bdbb5ca57ed79e9b0 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 2 Aug 2022 15:56:47 +0200 Subject: [PATCH] add zenodo dataset for download --- Snakefile | 30 +++++++++++++++--------------- config.default.yaml | 2 -- config.tutorial.yaml | 2 -- test/config.test1.yaml | 2 -- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Snakefile b/Snakefile index 6aaa9547..44803448 100644 --- a/Snakefile +++ b/Snakefile @@ -52,7 +52,7 @@ datafiles = ['ch_cantons.csv', 'je-e-21.03.02.xls', 'eez/World_EEZ_v8_2014.shp', 'hydro_capacities.csv', 'naturalearth/ne_10m_admin_0_countries.shp', 'NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp', 'nama_10r_3popgdp.tsv.gz', - 'nama_10r_3gdp.tsv.gz', 'corine/g250_clc06_V18_5.tif', 'shipdensity/shipdensity_global.zip'] + 'nama_10r_3gdp.tsv.gz', 'corine/g250_clc06_V18_5.tif'] if not config.get('tutorial', False): @@ -185,21 +185,21 @@ if config['enable'].get('retrieve_natura_raster', True): run: move(input[0], output[0]) -if config['enable'].get('build_ship_raster', False): - rule build_ship_raster: - input: - ship_density="data/bundle/shipdensity/shipdensity_global.zip", - cutouts=expand("cutouts/{cutouts}.nc", **config['atlite']) - output: "resources/europe_shipdensity_raster.nc" - log: "logs/build_ship_raster.log" - script: "scripts/build_ship_raster.py" +rule retrieve_ship_raster: + input: HTTP.remote("https://zenodo.org/record/6953563/files/shipdensity_global.zip", keep_local=True, static=True) + output: "data/shipdensity_global.zip" + run: move(input[0], output[0]) -if config['enable'].get('retrieve_ship_raster', True): - rule retrieve_ship_raster: - input: HTTP.remote("https://sandbox.zenodo.org/record/1089563/files/europe_shipdensity_raster.nc", keep_local=True, static=True) - output: "resources/europe_shipdensity_raster.nc" - run: move(input[0], output[0]) +rule build_ship_raster: + input: + ship_density="data/shipdensity_global.zip", + cutouts=expand("cutouts/{cutouts}.nc", **config['atlite']) + output: "resources/shipdensity_raster.nc" + log: "logs/build_ship_raster.log" + benchmark: "benchmarks/build_ship_raster" + script: "scripts/build_ship_raster.py" + rule build_renewable_profiles: input: @@ -211,7 +211,7 @@ rule build_renewable_profiles: gebco=lambda w: ("data/bundle/GEBCO_2014_2D.nc" if "max_depth" in config["renewable"][w.technology].keys() else []), - ship_density= lambda w: ("resources/europe_shipdensity_raster.nc" + ship_density= lambda w: ("resources/shipdensity_raster.nc" if "ship_threshold" in config["renewable"][w.technology].keys() else []), country_shapes='resources/country_shapes.geojson', diff --git a/config.default.yaml b/config.default.yaml index b287b87b..83f1cfd8 100755 --- a/config.default.yaml +++ b/config.default.yaml @@ -30,8 +30,6 @@ enable: retrieve_cutout: true build_natura_raster: false retrieve_natura_raster: true - build_ship_raster: false - retrieve_ship_raster: true custom_busmap: false electricity: diff --git a/config.tutorial.yaml b/config.tutorial.yaml index 5f81dbae..ed2f9bf0 100755 --- a/config.tutorial.yaml +++ b/config.tutorial.yaml @@ -31,8 +31,6 @@ enable: retrieve_cutout: true build_natura_raster: false retrieve_natura_raster: true - build_ship_raster: false - retrieve_ship_raster: true custom_busmap: false electricity: diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 4ed1e904..2f25b6eb 100755 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -30,8 +30,6 @@ enable: retrieve_cutout: true build_natura_raster: false retrieve_natura_raster: true - build_ship_raster: false - retrieve_ship_raster: true custom_busmap: false electricity: