xoa.coords.geo_unstack#
- xoa.coords.geo_unstack(obj, ref, stack_dim='npts')[source]#
Restore the geographic dimensions of ref from an object stacked with
geo_stack()The stacked dimension is reshaped to the dimensions of the longitude and latitude coordinates of ref, in the order used by
geo_stack(), and the coordinates of ref that are along them are restored with their values and attributes. Unlikexarray.DataArray.unstack(), the order of the coordinates is preserved.- Parameters:
obj (xarray.DataArray, xarray.Dataset) – Object with a stacked dimension, for instance computed from
geo_stack(ref)ref (xarray.DataArray, xarray.Dataset) – Object with valid longitude and latitude coordinates that was given to
geo_stack().stack_dim (str) – Name of the stacked dimension
- Returns:
xarray.DataArray, xarray.Dataset – The geographic dimensions are the last ones, with latitude before longitude. Scalar coordinates are restored if ref has a single position.
See also