xarray.DataArray.dggs.decode#
- DataArray.dggs.decode(grid_info=None, *, name='cell_ids', convention='xdggs', index_options=None, **index_kwargs)#
decode the DGGS cell ids
- Parameters:
grid_info (
dictorxdggs.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.
namepoints to the coordinate containing cell ids, and which has all the grid metadata. Thenameparameter defaults to"cell_ids".“cf”: the upcoming CF convention standardization. While the convention extension is specialized on
healpixfor now, the decoder can work with other DGGS as well. For this, all metadata lives on a variable with agrid_mapping_nameattribute, and the cell ids coordinate is indicated by thecoordinatesattribute on data variables / other coordinates (this can be overridden by thenameparameter).
index_options, **index_kwargs (
dict, optional) – Additional options to forward to the index.
- Returns:
obj (
xarray.DataArrayorxarray.Dataset) – The object with a DGGS index on the cell id coordinate.