xdggs.decode

Contents

xdggs.decode#

xdggs.decode(ds, grid_info=None, *, name='cell_ids')#

decode grid parameters and create a DGGS index

Parameters:
  • ds (xarray.Dataset) – The input dataset. Must contain a coordinate for the cell ids with at least the attributes grid_name and level.

  • grid_info (dict or DGGSInfo, optional) – Override the grid parameters on the dataset. Useful to set attributes on the dataset.

  • name (str, default: "cell_ids") – The name of the coordinate containing the cell ids.

Returns:

decoded (xarray.DataArray or xarray.Dataset) – The input dataset with a DGGS index on the cell id coordinate.