update Fabians review comments

This commit is contained in:
Philipp Glaum 2022-07-29 14:56:00 +02:00
parent 1009e2a0f6
commit ba7a5363e7
3 changed files with 9 additions and 9 deletions

View File

@ -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']
'nama_10r_3gdp.tsv.gz', 'corine/g250_clc06_V18_5.tif', 'shipdensity/shipdensity_global.zip']
if not config.get('tutorial', False):
@ -197,7 +197,7 @@ if config['enable'].get('build_ship_raster', False):
if config['enable'].get('retrieve_ship_raster', True):
rule retrieve_ship_raster:
input: HTTP.remote("path-to-file", keep_local=True, static=True)
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])

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: : 2017-2022 The PyPSA-Eur Authors
# SPDX-FileCopyrightText: : 2022 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
@ -26,7 +26,7 @@ Inputs
Outputs
-------
- ``resources/natura.tiff``: Reduced version of `Global ship density from <https://datacatalog.worldbank.org/search/dataset/0037580/` to reduce computation times.
- ``resources/europe_shipdensity_raster.nc``: Reduced version of `Global ship density from <https://datacatalog.worldbank.org/search/dataset/0037580/` to reduce computation time.
Description
-----------
@ -38,7 +38,7 @@ from _helpers import configure_logging
from build_natura_raster import determine_cutout_xXyY
import zipfile
import xarray
import xarray as xr
import os
logger = logging.getLogger(__name__)
@ -54,7 +54,7 @@ if __name__ == "__main__":
with zipfile.ZipFile(snakemake.input.ship_density) as zip_f:
zip_f.extract("shipdensity_global.tif")
ship_density=xarray.open_rasterio("shipdensity_global.tif")
ship_density = xr.open_rasterio("shipdensity_global.tif")
os.remove("shipdensity_global.tif")
ship_density = ship_density.drop(["band"]).sel(x=slice(min(xs),max(Xs)), y=slice(max(Ys),min(ys)))