Skip to content

Conversation

@bouweandela
Copy link
Member

@bouweandela bouweandela commented Dec 4, 2025

Description

Add support for loading data with xcube

Related to #2584

To use the data source, run

esmvaltool config copy data-xcube-ccizarr.yml

Example recipe, run it with --max-parallel-tasks 1 for now:

documentation:
  description: Example recipe that plots a map.

  title: Recipe that runs an example diagnostic written in Python.

  authors:
    - andela_bouwe

  maintainer:
    - andela_bouwe

  references:
    - acknow_project

  projects:
    - esmval
    - c3s-magic

datasets:
  - dataset: "ESACCI-WATERVAPOUR-L3C-TCWV-meris-005deg-2002-2017-fv3.2.zarr"

diagnostics:
  map:
    description: Global map of total column of water in January 2010.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tcwv:
        project: external
        mip: Amon
        frequency: mon
        timerange: 2010/P1M
        caption: Global map of {long_name} in January 2010 according to {dataset}.
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: pcolormesh
          cmap: Reds

This code currently skips all fixes and CMOR checks.

Link to documentation: https://esmvaltool--2917.org.readthedocs.build/projects/ESMValCore/en/2917/api/esmvalcore.io.xcube.html


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@bouweandela bouweandela added the enhancement New feature or request label Dec 4, 2025
- xcube-cci
- yamale
- zarr >3
- zarr >2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zarr3 is perfectly able to read zarr2 datasets, bud

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xcube requires zarr==2

Copy link
Contributor

@valeriupredoi valeriupredoi Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well that's a bummer - that means it can't read Zarr3 spec?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also Zarr2 is borderline archaic - good luck to us trying to maintain such an evironment

@valeriupredoi
Copy link
Contributor

this is shaping up nicely - couple quick questions: why not use the standard xarray - to iris via ncdata path? Is XCube really needed to load the ESA-CCI Zarr files, and if not, do we know what database they are in so we can bolt on an eg intake-esm functionality?

@bouweandela
Copy link
Member Author

bouweandela commented Dec 4, 2025

why not use the standard xarray - to iris via ncdata path?

That is exactly what is used:

return dataset_to_iris(dataset)
and
conversion_func = ncdata.iris_xarray.cubes_from_xarray

Is XCube really needed to load the ESA-CCI Zarr files

No, but it is convenient

do we know what database they are in

It looks like the data is available here: https://github.com/esa-cci/xcube-cci/blob/fe8ac26405bd36b0176e1a0cae30238f52009a10/xcube_cci/zarraccess.py#L47

so we can bolt on an eg intake-esm functionality?

That might be possible, but I'm not sure if that will be easier to maintain or less work. xcube supports an interesting range of data sources from ESA, Copernicus, Climate Data Store, and even Zenodo, so I think that having support for xcube will be an interesting feature for our users. Of course, that shouldn't stop us from adding support for intake-esm as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants