tool_load_cds

Standalone tool-specs compliant downloader for ERA5 from Copernicus

https://github.com/vforwater/tool_load_cds

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Standalone tool-specs compliant downloader for ERA5 from Copernicus

Basic Info
  • Host: GitHub
  • Owner: VForWaTer
  • License: cc0-1.0
  • Language: Python
  • Default Branch: main
  • Size: 46.9 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 12 months ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

toolloadcds

Docker Image CI DOI

A containerized Python tool for downloading climate data from the Copernicus Climate Data Store (CDS) and Google Earth Engine (GEE). This tool follows the Tool Specification for reusable research software using Docker.

Features

  • Download ERA5 climate data (precipitation, evaporation, temperature)
  • Download CMIP6 climate projections
  • Support for multiple backends:
    • Copernicus Climate Data Store (CDS)
    • Google Earth Engine (GEE)
  • Output in both CSV and Parquet formats
  • Point-based data extraction

How to build the image?

You can build the image from within the root of this repo by docker build -t tool_load_cds .

Use any tag you like. If you want to run and manage the container with toolbox-runner they should be prefixed by tbr_ to be recognized.

Alternatively, the contained .github/workflows/docker-image.yml will build the image for you on new releases on Github. You need to change the target repository in the aforementioned yaml.

How to run?

This tool installs the json2args python package to parse the parameters in the /in/inputs.json. This assumes that the files are not renamed and not moved and there is actually only one tool in the container. For any other case, the environment variables PARAM_FILE can be used to specify a new location for the inputs.json and TOOL_RUN can be used to specify the tool to be executed.

Authentication

For CDS backend:

You need to provide authentication for the Copernicus Climate Data Store. You have two options: 1. Mount your .cdsapirc file to /root/.cdsapirc in the container 2. Pass your CDS API key via the cds_api_key parameter (not recommended for production use)

For Earth Engine backend:

You need to mount your Google Cloud service account JSON file to /root/service-account.json in the container. The service account must have Earth Engine API enabled and the project must be registered with Earth Engine.

Example Usage

To invoke the docker container directly run something similar to: docker run --rm -it \ -v /path/to/local/in:/in \ -v /path/to/local/out:/out \ -v /path/to/.cdsapirc:/root/.cdsapirc \ -e TOOL_RUN=download_era5_series \ tool_load_cds

With the toolbox runner, this is simplified:

```python from toolboxrunner import listtools tools = list_tools() # dict with tool names as keys

downloadera5 = tools.get('downloadera5series') downloadera5.run( resultpath='./', longitude=8.4, latitude=49.0, variable="precipitation", startdate="2020-01-01", end_date="2020-12-31", backend="cds" ) ```

The example above will create a temporary file structure to be mounted into the container and then create a .tar.gz on termination of all inputs, outputs, specifications and some metadata, including the image sha256 used to create the output in the current working directory.

Available Tools

downloadera5series

Downloads ERA5 climate data for a specific location and time period.

Parameters: - longitude: The longitude of the area of interest - latitude: The latitude of the area of interest - variable: The climate variable to download (precipitation, evaporation, temperature) - start_date: The start date of the series (default: 2010-01-01) - end_date: The end date of the series (optional, defaults to current date) - cds_api_key: The CDS API key (optional, see authentication section) - backend: The backend to use (cds or earthengine, default: cds)

downloadcmip6series

Downloads CMIP6 climate projections for a specific location and time period.

Parameters: - longitude: The longitude of the area of interest - latitude: The latitude of the area of interest - variable: The climate variable to download (precipitation, temperature) - start_date: The start date of the series (default: 2025-01-01) - end_date: The end date of the series (default: 2050-12-31) - model: The GCM model to use (default: "EC-Earth3") - scenario: The scenario to use (ssp245, ssp585, default: "ssp585")

Output

The tool saves the downloaded data in two formats: 1. CSV file: /out/{prefix}{variable}.csv 2. Parquet file: /out/{prefix}{variable}.parquet

Where {prefix} is either "era5" or "cmip6{model}{scenario}" depending on the tool used.

Owner

  • Name: V-FOR-WaTer
  • Login: VForWaTer
  • Kind: organization

V-FOR-WaTer

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Tool Spec Python template
message: >-
  Please replace this citation information with appropriate
  metadata for your tool
type: software
authors:
  - given-names: Mirko
    family-names: Mälicke
    email: mirko.maelicke@KIT.edu
    affiliation: >-
      Institute for Water and Environment, Hydrology,
      Karlsruhe Institute for Technology (KIT)
    orcid: 'https://orcid.org/0000-0002-0424-2651'
repository-code: 'https://github.com/VForWaTer/tool_load_cds'
url: 'https://vforwater.github.io/tool-specs/'
abstract: >-
  This is a Github repository template for scientific data
  (pre-)processing tools follwoing the tool specs
  (https://vforwater.github.io/tool-specs/) for
  containerized scientific tools. You can use this
  repository as a starting point for scientific tools.
keywords:
  - docker
  - tool-spec
  - V-For-WaTer
license: CC-BY-4.0
version: '0.5'
date-released: '2024-07-30'

GitHub Events

Total
  • Issue comment event: 1
  • Push event: 4
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 1
Last Year
  • Issue comment event: 1
  • Push event: 4
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • cazs27 (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/docker-image.yml actions
  • actions/checkout v3 composite
  • docker/build-push-action v3 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
  • softprops/action-gh-release v1 composite
Dockerfile docker
  • python 3.12 build
docker-compose.yml docker