natural_neighbor

metpy.interpolate.natural_neighbor(xp, yp, variable, grid_x, grid_y)[source]

Generate a natural neighbor interpolation of the given points to a regular grid.

This assigns values to the given grid using the Liang and Hale [Liang2010]. approach.

Parameters:
  • xp ((N, ) ndarray) – x-coordinates of observations
  • yp ((N, ) ndarray) – y-coordinates of observations
  • variable ((N, ) ndarray) – observation values associated with (xp, yp) pairs. IE, variable[i] is a unique observation at (xp[i], yp[i])
  • grid_x ((M, 2) ndarray) – Meshgrid associated with x dimension
  • grid_y ((M, 2) ndarray) – Meshgrid associated with y dimension
Returns:

img ((M, N) ndarray) – Interpolated values on a 2-dimensional grid

Deprecated since version 0.9.0: Function has been renamed to natural_neighbor_to_grid and will be removed from MetPy in 0.12.0.