uxarray.UxDataArray.remap.inverse_distance_weighted

uxarray.UxDataArray.remap.inverse_distance_weighted#

UxDataArray.remap.inverse_distance_weighted(destination_grid, remap_to='faces', power=2, k=8, **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.

Returns:

A new object with data mapped onto destination_grid.

Return type:

UxDataArray or UxDataset