xarray.Dataset.dggs.decode

xarray.Dataset.dggs.decode#

Dataset.dggs.decode(grid_info=None, *, name='cell_ids', convention='xdggs', index_options=None, **index_kwargs)#

decode the DGGS cell ids

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

  • name (str, optional) – The name of the coordinate containing the cell ids. The default name depends on the convention.

  • convention (str, default: "xdggs") – The name of the metadata convention. Built-in conventions are:

    • “xdggs”: the existing xdggs convention. name points to the coordinate containing cell ids, and which has all the grid metadata. The name parameter defaults to "cell_ids".

    • “cf”: the upcoming CF convention standardization. While the convention extension is specialized on healpix for now, the decoder can work with other DGGS as well. For this, all metadata lives on a variable with a grid_mapping_name attribute, and the cell ids coordinate is indicated by the coordinates attribute on data variables / other coordinates (this can be overridden by the name parameter).

  • index_options, **index_kwargs (dict, optional) – Additional options to forward to the index.

Returns:

obj (xarray.DataArray or xarray.Dataset) – The object with a DGGS index on the cell id coordinate.