Merge pull request #818 from PyPSA/wdpa-no-bYYYY

WDPA time-invariant resource files
This commit is contained in:
Fabian Neumann 2023-12-29 11:22:24 +01:00 committed by GitHub
commit 6ee82e030f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -210,8 +210,8 @@ rule determine_availability_matrix_MD_UA:
input:
copernicus=RESOURCES
+ "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif",
wdpa=RESOURCES + f"WDPA_{bYYYY}.gpkg",
wdpa_marine=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg",
wdpa=RESOURCES + f"WDPA.gpkg",
wdpa_marine=RESOURCES + f"WDPA_WDOECM_marine.gpkg",
gebco=lambda w: (
"data/bundle/GEBCO_2014_2D.nc"
if "max_depth" in config["renewable"][w.technology].keys()

View File

@ -255,7 +255,7 @@ if config["enable"]["retrieve"]:
# Basic pattern where WDPA files can be found
url_pattern = (
"https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public.zip"
"https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public_shp.zip"
)
# 3-letter month + 4 digit year for current/previous/next month to test
@ -286,10 +286,10 @@ if config["enable"]["retrieve"]:
keep_local=True,
),
params:
zip=RESOURCES + f"WDPA_{bYYYY}_shp.zip",
folder=directory(RESOURCES + f"WDPA_{bYYYY}"),
zip=RESOURCES + f"WDPA_shp.zip",
folder=directory(RESOURCES + f"WDPA"),
output:
gpkg=RESOURCES + f"WDPA_{bYYYY}.gpkg",
gpkg=RESOURCES + f"WDPA.gpkg",
run:
shell("cp {input} {params.zip}")
shell("unzip -o {params.zip} -d {params.folder}")
@ -312,10 +312,10 @@ if config["enable"]["retrieve"]:
keep_local=True,
),
params:
zip=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.zip",
folder=directory(RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine"),
zip=RESOURCES + f"WDPA_WDOECM_marine.zip",
folder=directory(RESOURCES + f"WDPA_WDOECM_marine"),
output:
gpkg=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg",
gpkg=RESOURCES + f"WDPA_WDOECM_marine.gpkg",
run:
shell("cp {input} {params.zip}")
shell("unzip -o {params.zip} -d {params.folder}")