A data store to access datasets from ICOS Data Portal.
Project description
xcube-icosdp
xcube-icosdp is a Python package and xcube plugin
that provides a data store for accessing data from the
ICOS Data Portal.
Supported Datasets
The plugin currently supports the FLUXCOM-X-BASE products for carbon and water fluxes. For details on FLUXCOM-X-BASE data products, see:
Nelson and Walther et al. (2024): https://doi.org/10.5194/egusphere-2024-165
X-BASE contains four flux variables:
- FLUXCOM-X-BASE_NEE — Net Ecosystem Exchange
- FLUXCOM-X-BASE_GPP — Gross Primary Productivity
- FLUXCOM-X-BASE_ET — Evapotranspiration
- FLUXCOM-X-BASE_ET_T — Transpiration
To improve usability, the data is available through:
✅ Native resolution via cloud-optimized access (spatial/temporal subsetting) ✅ Pre-computed spatial & temporal aggregations
Native Full-Resolution Dataset
- 005_hourly — 0.05° spatial and hourly temporal resolution for 2001–2021 (~3 TB)
Each dataset has dimensions (time, hour, lat, lon) and includes a land_fraction variable.
The data is stored in Zarr format on a publicly accessible object storage hosted by DKRZ. It is cloud-optimized, allowing efficient spatial and temporal subsetting. No authentication is required to access the dataset.
Using the xcube-icosdp Data Store to access the full-resolution dataset
Example: open the NEE flux for 2020–2021 over a custom bounding box:
from xcube.core.store import new_data_store
store = new_data_store("icosdp")
ds = store.open_data(
data_id="FLUXCOM-X-BASE_NEE",
time_range=("2020-01-01", "2021-12-31"),
bbox=[5, 45, 10, 50] # lon_min, lat_min, lon_max, lat_max
)
🌐 Public data — no authentication required at this time. 📖 Example notebook
Aggregated Products
All aggregated datasets are distributed through the ICOS ERIC Carbon Portal (CC BY-4.0 license) in NetCDF format.
Current aggregations:
| Dataset | Spatial Resolution | Temporal Resolution | Size per Year | Dimensions |
|---|---|---|---|---|
| 050_monthly | 0.5° | Monthly | ~5 MB | (time, lat, lon) |
| 025_monthlycycle | 0.25° | Monthly mean diurnal cycle | ~270 MB | (time, hour, lat, lon) |
| 025_daily | 0.25° | Daily | ~380 MB | (time, lat, lon) |
| 005_monthly | 0.05° | Monthly | ~450 MB | (time, lat, lon) |
All files include land_fraction.
The aggregated products are available exclusively through the ICOS Data Portal. To access them, users must create an account and provide their registered email address and password to the data store. Note that the authentication process does not support lazy loading of the dataset. Therefore, the data must be preloaded, which involves downloading the global annual datasets and constructing a unified data cube from them by stacking along the time axis.
Example: access the NEE flux from the moonthly aggregate for 2015 to 2021 over a custom bounding box:
from xcube.core.store import new_data_store
store = new_data_store("icosdp", email="xxx", password="xxx")
cache_store = store.preload_data(
"FLUXCOM-X-BASE_NEE",
agg_mode="050_monthly",
time_range=("2015-01-01", "2021-12-31"),
bbox=[5, 45, 10, 50],
)
ds = cache_store.open_data("FLUXCOM-X-BASE_NEE_monthly_2015_2021.zarr")
🌐 Public data — authentication via ICOS account required. 📖 Example notebook
Installing the xcube-icosdp plugin
This section describes three alternative methods you can use to install the xcube-icosdp plugin.
For installation of conda packages, we recommend
mamba. It is also possible to use conda,
but note that installation may be significantly slower with conda than with
mamba. If using conda rather than mamba, replace the mamba command with
conda in the installation commands given below.
Installation into a new environment with pip
This method creates a new environment and installs the latest PyPi release of xcube-icosdp, along with all its required dependencies.
To do so, execute the following commands:
pip install xcube-icosdp
Installation from the repository
If you want to install xcube-icosdp directly from the git repository (for example in order to use an unreleased version or to modify the code), you can do so as follows:
mamba create -f environment.yml
mamba activate xcube-icosdp
git clone https://github.com/xcube-dev/xcube-icosdp.git
python -m pip install --no-deps --editable xcube-icosdp/
This installs all the dependencies of xcube-icosdp into a fresh conda environment, then installs xcube-icosdp in editable mode into this environment from the repository.
Testing
To run the unit test suite:
pytest
To analyze test coverage:
pytest --cov=xcube_icosdp
To produce an HTML coverage report:
pytest --cov-report html --cov=xcube_icosdp
Some notes on the strategy of unit-testing
The unit test suite uses pytest-recording
to mock https requests via the Python library requests. During development an
actual HTTP request is performed and the responses are saved in cassettes/**.yaml
files. During testing, only the cassettes/**.yaml files are used without an actual
HTTP request. During development, to save the responses to cassettes/**.yaml, run
pytest -v -s --record-mode new_episodes
Note that --record-mode new_episodes overwrites all cassettes. If one only
wants to write cassettes which are not saved already, --record-mode once can be used.
pytest-recording supports all records
modes given by VCR.py.
After recording the cassettes, testing can be then performed as usual.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xcube_icosdp-0.1.1.tar.gz.
File metadata
- Download URL: xcube_icosdp-0.1.1.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
345c530a25b55bdedd894a6b10a095ba3437fa033b71bccb8149341d86cdb545
|
|
| MD5 |
81e793ba3189f1d07b8a859b15393717
|
|
| BLAKE2b-256 |
7a9ffbfb7a2909db8c75cc5acf746d84528f33a1199d8616684971c1a51bf8d4
|
File details
Details for the file xcube_icosdp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xcube_icosdp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d823032824214c64301f6a8f76075934387ddffff1ebe314aee59d78c01c2362
|
|
| MD5 |
a7b19cb68025bbf261d2593841ee66e8
|
|
| BLAKE2b-256 |
d62c40d6f491bc6cd49c904134e10253bd5a183bdf4d536a6fbe8c1bc18742df
|