mesmer.xarray_utils.grid.stack_lat_lon(data, *, x_dim='lon', y_dim='lat', stack_dim='gridcell', multiindex=False, dropna=True)#

Stack a regular lat-lon grid to a 1D (unstructured) grid

  • data (xr.Dataset | xr.DataArray) – Array to convert to an 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.

  • multiindex (bool, default: False) – If the new stack_dim should be returned as a MultiIndex.

  • dropna (bool, default: True) – Drops each ‘gridcell’ if any NA values are present at any point in the timeseries.


data (xr.Dataset | xr.DataArray) – Array converted to an 1D grid.