earth2mip.datasets package#

earth2mip.datasets.era5#

earth2mip.datasets.era5.open_34_vars(path, f=None)#

Open 34Vars hdf5 file

Parameters:
  • path (str) – local path to hdf5 file

  • f (Any | None) – an optional file-like object to load the data from. Useful for remote data and fsspec.

Return type:

DataArray

Examples

>>> import earth2mip.datasets
>>> path = "/out_of_sample/2018.h5"
>>> datasets.era5.open_34_vars(path)
<xarray.DataArray 'fields' (time: 1460, channel: 34, lat: 721, lon: 1440)>
dask.array<array, shape=(1460, 34, 721, 1440), dtype=float32, chunksize=(1, 1, 721, 1440), chunktype=numpy.ndarray> # noqa
Coordinates:
* time     (time) datetime64[ns] 2018-01-01 ... 2018-12-31T18:00:00
* lat      (lat) float64 90.0 89.75 89.5 89.25 ... -89.25 -89.5 -89.75 -90.0
* lon      (lon) float64 0.0 0.25 0.5 0.75 1.0 ... 359.0 359.2 359.5 359.8
* channel  (channel) <U5 'u10' 'v10' 't2m' 'sp' ... 'v900' 'z900' 't900'
Attributes:
    selene_path:  /lustre/fsw/sw_climate_fno/34Var
    description:  ERA5 data at 6 hourly frequency with snapshots at 0000, 060...
    path:         /out_of_sample/2018.h5
earth2mip.datasets.era5.open_hdf5(*, path, f=None, metadata)#

earth2mip.datasets.hindcast module#

Routines for opening fcn-mip hindcast outputs

earth2mip.datasets.hindcast.open_forecast(root, group, chunks=None)#

Open a fcn-mip forecast as single xarray object

The directory structure should contain items like this:

{root}/2018-01-01T00:00:00/mean.zarr/ {root}/2018-01-02T00:00:00/mean.zarr/

earth2mip.datasets.zarr_directory module#

class earth2mip.datasets.zarr_directory.NestedDirectoryStore(map, directories, group, concat_dim='initial_time', static_coords=(), dim_rename=None)#

Bases: MutableMapping

Reads data like this:

{root}/a/{group}/{variable}
{root}/b/{group}/{variable}

The data are assumed to have identical shape and chunking and require a .zmetadata file. This store maps

{root}/a/{group}/{variable}/0 -> {group}/{variable}/0.0

Module contents#