Skip to content

Commit

Permalink
Xarray-zarr example dataset recipe (#108)
Browse files Browse the repository at this point in the history
* add a working xarray-zarr example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: b8raoult <[email protected]>
  • Loading branch information
3 people authored Nov 1, 2024
1 parent 88a8a27 commit 44c1b99
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
12 changes: 12 additions & 0 deletions docs/building/sources/xarray-zarr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@
xarray-zarr
#############

Here is an example recipe that builds a dataset using one of the many
regridded versions of ERA5 hosted by Google in Analysis-Ready, Cloud
Optimized format. See `here
<https://cloud.google.com/storage/docs/public-datasets/era5>`_ for more
information.

.. literalinclude:: yaml/xarray-zarr.yaml
:language: yaml

Note that unlike the ``mars`` examples, there is no need to include a
``grid`` specification. Also, in order to subselect the vertical levels,
it is necessary to use the :ref:`join <building-join>` operation to join
separate lists containing 2D variables and 3D variables. If all vertical
levels are desired, then it is OK to specify a single source.
23 changes: 21 additions & 2 deletions docs/building/sources/yaml/xarray-zarr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
dates:
start: 2021-01-01T00:00:00
end: 2021-01-10T12:00:00
frequency: 6h

input:
xarray-zarr:
url: https://...
join:
- xarray-zarr:
url: "gs://gcp-public-data-arco-era5/ar/1959-2022-6h-128x64_equiangular_conservative.zarr"
param:
- surface_pressure
- 2m_temperature
- 10m_u_component_of_wind
- 10m_v_component_of_wind

- xarray-zarr:
url: "gs://gcp-public-data-arco-era5/ar/1959-2022-6h-128x64_equiangular_conservative.zarr"
param:
- temperature
level:
- 1000
- 500

0 comments on commit 44c1b99

Please sign in to comment.