uxarray.UxDataset.remap.inverse_distance_weighted

uxarray.UxDataset.remap.inverse_distance_weighted#

UxDataset.remap.inverse_distance_weighted(destination_grid, remap_to='faces', power=2, k=8, backend='uxarray', yac_method=None, yac_options=None, **kwargs)#

Perform inverse-distance-weighted (IDW) remapping.

Each destination point is a weighted average of nearby source points, with weights proportional to 1/(distance**power).

Parameters:
  • destination_grid (Grid) – The UXarray grid to which data will be interpolated.

  • remap_to ({'nodes', 'edges', 'faces'}, default='faces') – Which grid element receives the remapped values.

  • power (int, default=2) – Exponent controlling distance decay. Larger values make the interpolation more local.

  • k (int, default=8) – Number of nearest source points to include in the weighted average.

  • backend ({'uxarray', 'yac'}, default='uxarray') – Remapping backend to use. When set to ‘yac’, requires YAC to be available on PYTHONPATH.

  • yac_method ({'nnn', 'conservative'}, optional) – YAC interpolation method. Required when backend=’yac’.

  • yac_options (dict, optional) – YAC interpolation configuration options.

Returns:

A new object with data mapped onto destination_grid.

Return type:

UxDataArray or UxDataset

Notes

When backend="yac", this method delegates to YAC’s average interpolation method through the low-level yac.core Python bindings. See the YAC documentation and installation guide: