xarray.Dataset.regridder.horizontal_regrid2#

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

Pure python implementation of CDAT’s regrid2 horizontal regridder.

Regrids data_var in dataset to output_grid using regrid2’s algorithm.

Options documentation xcdat.regridder.regrid2.Regrid2Regridder()

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 regrid2:

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