xarray.Dataset.regridder.horizontal_xesmf#

Dataset.regridder.horizontal_xesmf(data_var, output_grid, **options)#

Wraps the xESMF library providing access to regridding between structured rectilinear and curvilinear grids.

Regrids data_var in dataset to output_grid.

Option documentation xcdat.regridder.xesmf.XESMFRegridder()

Parameters
  • data_var (str) – Name of the variable in the xr.Dataset to regrid.

  • output_grid (xr.Dataset) – Dataset containing output grid.

  • options (Dict[str, Any]) – Dictionary with extra parameters for the regridder.

Returns

xr.Dataset – With the data_var variable on the grid defined in output_grid.

Raises

ValueError – If tool is not supported.

Examples

Generate output grid:

>>> output_grid = xcdat.create_gaussian_grid(32)

Regrid data to output grid using xesmf:

>>> ds.regridder.horizontal_xesmf("ts", output_grid)