xoa.coords.geo_stack
- xoa.coords.geo_stack(obj, stack_dim='npts', rename=False, drop=False, reset_index=False)[source]
Stack the dimensions of longitude and latitude coordinates
Note
If already stacked or similar, a simple copy is returned, except if rename is True.
- Parameters
obj (xarray.DataArray, xarray.Dataset) – Object with valid longitude and latitude coordinates
stack_dim (str) – Name of the new stack dimension
rename (False) – Rename longitude to lon and latitude to lat for convenience. If no need to stack, rename the single dimension to stack_dim.
drop (bool) – Drop all variables and coordinates that does not contain final stack dimension
- Returns
xarray.DataArray, xarray.Dataset – Array or dataset with lon and lat stacked. Its “geo_stack”
encodingattribute value is set to (stack_dim, lon_dim, lat_dim).
See also