- metpy.interpolate.inverse_distance_to_grid(xp, yp, variable, grid_x, grid_y, r, gamma=None, kappa=None, min_neighbors=3, kind='cressman')#
Generate an inverse distance interpolation of the given points to a regular grid.
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.
r (float) – Radius from grid center, within which observations are considered and weighted.
gamma (float) – Adjustable smoothing parameter for the barnes interpolation. Default None.
kappa (float) – Response parameter for barnes interpolation. Default None.
min_neighbors (int) – Minimum number of neighbors needed to perform barnes or cressman interpolation for a point. Default is 3.
kind (str) – Specify what inverse distance weighting interpolation to use. Options: ‘cressman’ or ‘barnes’. Default ‘cressman’
img ((M, N) ndarray) – Interpolated values on a 2-dimensional grid