xdggs.conventions.Convention.encode#
- Convention.encode(obj, *, encoding=None)#
Encode according to the convention.
This takes a dataset with a DGGSIndex and performs the necessary mutations to convert from the xdggs convention to the convention in question.
Note that this must drop the DGGSIndex.
- Parameters:
ds (
xarray.Dataset) – The dataset to encode. Must have a DGGSIndex.encoding (mapping of
strtoAny, optional) – Additional options for the convention.
- Returns:
encoded (
xarray.Dataset) – The encoded dataset.