uxarray.remap.nearest_neighbor._nearest_neighbor

uxarray.remap.nearest_neighbor._nearest_neighbor#

uxarray.remap.nearest_neighbor._nearest_neighbor(source_grid, destination_grid, source_data, remap_to='nodes', coord_type='spherical')#

Nearest Neighbor Remapping between two grids, mapping data that resides on the corner nodes, edge centers, or face centers on the source grid to the corner nodes, edge centers, or face centers of the destination grid.

Parameters:
  • source_grid (Grid) – Source grid that data is mapped to

  • destination_grid (Grid) – Destination grid to remap data to

  • source_data (np.ndarray) – Data variable to remaps

  • remap_to (str, default="nodes") – Location of where to map data, either “nodes”, “edge centers”, or “face centers”

  • coord_type (str, default="spherical") – Coordinate type to use for nearest neighbor query, either “spherical” or “Cartesian”

Returns:

destination_data – Data mapped to destination grid

Return type:

np.ndarray