xcdat.regridder.regrid2.Regrid2Regridder#

class xcdat.regridder.regrid2.Regrid2Regridder(input_grid, output_grid, unmapped_to_nan=True, output_weights=False, create_nan_mask=False, **options)[source]#
__init__(input_grid, output_grid, unmapped_to_nan=True, output_weights=False, create_nan_mask=False, **options)[source]#

Pure python implementation of the regrid2 horizontal regridder from CDMS2’s regrid2 module.

Regrid data from input_grid to output_grid.

Available options: None

Parameters:
  • input_grid (xr.Dataset) – Dataset containing the source grid.

  • output_grid (xr.Dataset) – Dataset containing the destination grid.

  • unmapped_to_nan (bool) – If True, unmapped values are set to NaN. Default is True.

  • output_weights (bool | str) – If True, output weights are added to the output dataset as weights. If str, the name of the variable to store the weights. Default is False.

  • create_nan_mask (bool) – If True, a mask is created using the nan values from source variable. If a mask already exists in the Dataset it will be ignored. Default is False.

  • **options (Any) – Dictionary with extra parameters for the regridder.

Examples

Import xCDAT:

>>> import xcdat

Open a dataset:

>>> ds = xcdat.open_dataset("...")

Create output grid:

>>> output_grid = xcdat.create_gaussian_grid(32)

Regrid data:

>>> output_data = ds.regridder.horizontal("ts", output_grid)

Methods

__init__(input_grid, output_grid[, ...])

Pure python implementation of the regrid2 horizontal regridder from CDMS2's regrid2 module.

horizontal(data_var, ds)

See documentation in xcdat.regridder.regrid2.Regrid2Regridder()

vertical(data_var, ds)

Placeholder for base class.

vertical(data_var, ds)[source]#

Placeholder for base class.

horizontal(data_var, ds)[source]#

See documentation in xcdat.regridder.regrid2.Regrid2Regridder()

_abc_impl = <_abc._abc_data object>#