inverse_distance_to_points

metpy.interpolate.inverse_distance_to_points(points, values, xi, r, gamma=None, kappa=None, min_neighbors=3, kind='cressman')[source]

Generate an inverse distance weighting interpolation to the given points.

Values are assigned to the given interpolation points based on either [Cressman1959] or [Barnes1964]. The Barnes implementation used here based on [Koch1983].

Parameters:
  • points (array_like, shape (n, 2)) – Coordinates of the data points.
  • values (array_like, shape (n,)) – Values of the data points.
  • xi (array_like, shape (M, 2)) – Points to interpolate the data onto.
  • 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’
Returns:

img ((M,) ndarray) – Array representing the interpolated values for each input point in xi