lair.geo.BaseGrid.regrid#

BaseGrid.regrid(out_grid, method='bilinear', inplace=False)[source]#

Regrid the data to a new grid. Uses xesmf for regridding.

Note

At present, xesmf only supports regridding lat-lon grids. self.data must be on a lat-lon grid. Possibly could use xesmf.frontend.BaseRegridder to regrid to a generic grid.

Warning

xarray.Dataset.cf.add_bounds is known to have issues, including near the 180th meridian. Care should be taken when using this method, especially with global datasets.

Parameters:
  • out_grid (xr.DataArray) – The new grid to resample to. Must be a lat-lon grid.

  • method (str, optional) – The regridding method, by default ‘bilinear’.

  • inplace (bool, optional) – Whether to modify the object in-place. Default is False.

Returns:

BaseGrid – The regridded grid

Return type:

Self

See also

regrid

The same for xarray data.

BaseGrid.resample

To a new resolution over the same area.