Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EEZ data source to enable direct download in the workflow #99

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* **ADD** sync infrastructure to easily send and receive files to and from a cluster (#74).
* **ADD** optional email notifications whenever builds fail or succeed (#92).

* **UPDATE** ENTSOE national electricity load data gap filling priority order included in config (#42)
* **UPDATE** EEZ is now be downloaded within the workflow, rather than depending on a manual download.
brynpickering marked this conversation as resolved.
Show resolved Hide resolved
* **UPDATE** ENTSOE national electricity load data gap filling priority order included in config (#42).
* **UPDATE** IRENA hydro generation data from 2018 to 2020 (#40).
* **UPDATE** Make scaling pumped hydro capacity according to Geth et al. (2015) optional with a boolean config parameter `scale-phs-according-to-geth-et-al` which defaults to False (no scaling) (#49).
* **UPDATE** JRC hydro database v4 -> v7 (#48). This entails one patch being removed:
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ conda activate euro-calliope

4. You need an account at the Copernicus Climate Data Service and you need to create a `$HOME/.cdsapirc` file with your credentials, see their [How To](https://cds.climate.copernicus.eu/api-how-to) (you do not need to manually install the client).

5. Further, you need all data files that cannot be retrieved automatically:

* [Maritime Boundaries v10 -> World Exclusive Economic Zones v10](http://www.marineregions.org/downloads.php), to be placed in `./data/World_EEZ_v10_20180221`

## Build the model

Because input data is large, the actual model including its data is not part of this repository. To use the model, you first need to build it from input data and scripts. Running the build step will build the model in the `./model` folder.
Expand Down
2 changes: 1 addition & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
data-sources:
biofuel-potentials: data/biofuels/potentials/{feedstock}.csv
biofuel-costs: data/biofuels/costs/{feedstock}.csv
eez: data/World_EEZ_v10_20180221/eez_v10.shp
eez: https://geo.vliz.be/geoserver/MarineRegions/wfs?service=WFS&version=1.0.0&request=GetFeature&typeNames=MarineRegions:eez&outputFormat=SHAPE-ZIP
irena-generation: data/irena/hydro-generation-europe.csv
national-phs-storage-capacities: data/pumped-hydro/storage-capacities-gwh.csv
capacity-factors: https://zenodo.org/record/3899687/files/{filename}?download=1
Expand Down
19 changes: 15 additions & 4 deletions rules/shapes.smk
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,28 @@ rule units_without_shape:
script: "../scripts/shapes/nogeo.py"


rule download_eez:
message: "Download Exclusive Economic Zones as zip"
output: protected("data/automatic/eez.zip")
params: url = config["data-sources"]["eez"]
conda: "../envs/shell.yaml"
shell: "curl -sLo {output} '{params.url}'"


rule eez:
message: "Clip exclusive economic zones to study area."
input: config["data-sources"]["eez"]
input: rules.download_eez.output[0]
output: "build/data/eez.geojson"
params:
bounds="{x_min},{y_min},{x_max},{y_max}".format(**config["scope"]["bounds"]),
countries=",".join(["'{}'".format(country) for country in config["scope"]["countries"]])
countries=",".join(["'{}'".format(country) for country in config["scope"]["countries"]]),
temp_dir = "build/data/eez"
conda: "../envs/geo.yaml"
shell:
"""
fio cat --bbox {params.bounds} {input}\
| fio filter "f.properties.Territory1 in [{params.countries}]"\
unzip -o {input} -d {params.temp_dir}
fio cat --bbox {params.bounds} {params.temp_dir}/eez.shp\
brynpickering marked this conversation as resolved.
Show resolved Hide resolved
| fio filter "f.properties.territory1 in [{params.countries}]"\
brynpickering marked this conversation as resolved.
Show resolved Hide resolved
| fio collect > {output}
rm -r {params.temp_dir}
brynpickering marked this conversation as resolved.
Show resolved Hide resolved
"""