mesmer.core.grid.unstack_lat_lon_and_align#
- mesmer.core.grid.unstack_lat_lon_and_align(data, coords_orig, *, x_dim='lon', y_dim='lat', stack_dim='gridcell')#
unstack an 1D grid to a regular lat-lon grid and align with original coords
- Parameters:
data (xr.Dataset | xr.DataArray) – Array with 1D grid to unstack and align.
coords_orig (xr.Dataset | xr.DataArray) – xarray object containing the original coordinates before it was converted to the 1D grid.
x_dim (str, default: “lon”) – Name of the x-dimension.
y_dim (str, default: “lat”) – Name of the y-dimension.
stack_dim (str, default: “gridcell”) – Name of the new dimension.
- Returns:
data (xr.Dataset | xr.DataArray) – Array converted to a regular lat-lon grid.