natural_neighbor_to_grid#

metpy.interpolate.natural_neighbor_to_grid(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 ((P, ) numpy.ndarray) – x-coordinates of observations

  • yp ((P, ) numpy.ndarray) – y-coordinates of observations

  • variable ((P, ) numpy.ndarray) – observation values associated with (xp, yp) pairs. IE, variable[i] is a unique observation at (xp[i], yp[i])

  • grid_x ((M, N) numpy.ndarray) – Meshgrid associated with x dimension

  • grid_y ((M, N) numpy.ndarray) – Meshgrid associated with y dimension

Returns:

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