ncdata.iris_xarray module#

Interface routines for converting data between Xarray and Iris.

Convert Dataset to and from Iris Cube\s.

By design, these transformations should be equivalent to saving data from one package to a netcdf file, and re-loading into the other package. There is also support for passing additional keywords to the appropriate load/save routines.

ncdata.iris_xarray.cubes_from_xarray(xrds, xr_save_kwargs=None, iris_load_kwargs=None)#

Convert an xarray xarray.Dataset to an Iris iris.cube.CubeList.

Equivalent to saving the dataset to a netcdf file, and loading that with Iris.

Netcdf variable data in the output contains the same array objects as the input, i.e. arrays (Dask or Numpy) are not copied or computed.

Parameters:
Returns:

cubes – loaded cubes

Return type:

iris.cube.CubeList

ncdata.iris_xarray.cubes_to_xarray(cubes, iris_save_kwargs=None, xr_load_kwargs=None)#

Convert Iris iris.cube.Cube\s to an xarray xarray.Dataset.

Equivalent to saving the dataset to a netcdf file, and loading that with Xarray.

Netcdf variable data in the output contains the same array objects as the input, i.e. arrays (Dask or Numpy) are not copied or computed.

Parameters:
Returns:

xrds – converted data in the form of an Xarray xarray.Dataset

Return type:

xarray.Dataset