Skip to content

XarrayBackend

Import path: earth2studio.io.XarrayBackend

View source on GitHub

Documentation

An in-memory IO backend holding an xarray.Dataset.

Stored arrays are NumPy-backed regardless of the payload written. The dataset is available as root.

Parameters:

  • xr_kwargs (Any, default: {} ) –

    Optional keyword arguments passed to the xarray.Dataset constructor, such as global attrs.

add_array

add_array(template: DataArray) -> None

Create the arrays a template describes.

Parameters:

  • template (DataArray) –

    Concrete coordinate signature; field values are never read.

write

write(x: DataArray) -> None

Write a field at the positions its coordinate labels identify.

Parameters:

  • x (DataArray) –

    NumPy-, CuPy- or Torch-backed field. It is never modified.