xhealpixify.regridder.HealpyRegridder

xhealpixify.regridder.HealpyRegridder#

class xhealpixify.regridder.HealpyRegridder(input_grid: ~xarray.core.dataset.Dataset, output_grid: ~xarray.core.dataset.Dataset, method: str = 'bilinear', interpolation_kwargs: dict = <factory>, weights_path: str | ~os.PathLike | None = None)#

regrid the given dataset to a healpix grid

Parameters:
  • source_grid (xarray.Dataset) – The source dataset. Has to have "latitude" and "longitude" coordinates.

  • target_grid (xarray.Dataset) – The target grid. Has to have "latitude" and "longitude" coordinates.

  • method (str, default: "bilinear") – The interpolation method. For now, only bilinear exists.

  • interpolation_kwargs (dict, optional) – Additional parameters for the interpolation method.

Warning

At the moment, none of the interpolation methods can deal with the nature of spherical coordinates on the plane. This means that global interpolation will fail in regions close to the poles and the ante-meridian. For regional interpolation make sure that the ante-meridian is far from the interpolation domain (for example by choosing the coordinate range – 0° to 360° or -180° to 180° – appropriately). Regions close to the poles will still fail to interpolate.

__init__(input_grid: ~xarray.core.dataset.Dataset, output_grid: ~xarray.core.dataset.Dataset, method: str = 'bilinear', interpolation_kwargs: dict = <factory>, weights_path: str | ~os.PathLike | None = None) None#

Methods

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

regrid_ds(ds)

regrid a dataset on the same grid as the input grid

Attributes

method

weights_path

input_grid

output_grid

interpolation_kwargs

weights