uxarray.UxDataset.remap.nearest_neighbor

uxarray.UxDataset.remap.nearest_neighbor#

UxDataset.remap.nearest_neighbor(destination_grid, remap_to='faces', backend='uxarray', yac_method='nnn', yac_options=None, **kwargs)#

Perform nearest-neighbor remapping.

Each destination point takes the value of its closest source point.

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.

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

  • yac_method ({'nnn', 'average', 'conservative'}, optional) – YAC interpolation method. Defaults to ‘nnn’ 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", remapping uses YAC’s low-level yac.core Python bindings. See the YAC documentation and installation guide: