xarray.DataArray.dggs.encode

xarray.DataArray.dggs.encode#

DataArray.dggs.encode(convention, *, encoding=None)#

Encode the dataset to the given convention

Parameters:

convention (str) – The name of the convention. Supported are:

  • “easygems”: grid_mapping coordinate and cell dimension and cell coordinate with a pandas index.

  • “cf”: grid_mapping coordinate with cell_index coordinate and cell dimension.

  • “xdggs”: cell_ids coordinate with grid metadata and a cells coordinate.

Returns:

obj (xarray.DataArray or xarray.Dataset) – The object converted to the given dimension.