pysteps.utils.interpolate.rbfinterp2d

pysteps.utils.interpolate.rbfinterp2d(coord, input_array, xgrid, ygrid, rbfunction='gaussian', epsilon=10, k=50, nchunks=5)

Fast 2-D grid interpolation of a sparse (multivariate) array using a radial basis function.

Parameters
coord: array_like

Array of shape (n, 2) containing the coordinates of the data points into a 2-dimensional space.

input_array: array_like

Array of shape (n) or (n, m) containing the values of the data points, where n is the number of data points and m the number of co-located variables. All values in input_array are required to have finite values.

xgrid, ygrid: array_like

1D arrays representing the coordinates of the 2-D output grid.

rbfunction: {“gaussian”, “multiquadric”, “inverse quadratic”, “inverse multiquadric”, “bump”}, optional

The name of one of the available radial basis function based on a normalized Euclidian norm as defined in the Notes section below.

More details provided in the wikipedia reference page linked below.

epsilon: float, optional

The shape parameter used to scale the input to the radial kernel.

A smaller value for epsilon produces a smoother interpolation. More details provided in the wikipedia reference page linked below.

k: int or None, optional

The number of nearest neighbours used for each target location. This can also be useful to to speed-up the interpolation. If set to None, it interpolates using all the data points at once.

nchunks: int, optional

The number of chunks in which the grid points are split to limit the memory usage during the interpolation.

Returns
output_array: ndarray

The interpolated field(s) having shape (m, ygrid.size, xgrid.size).

Notes

The coordinates are normalized before computing the Euclidean norms:

x = (x - min(x)) / max[max(x) - min(x), max(y) - min(y)],

y = (y - min(y)) / max[max(x) - min(x), max(y) - min(y)],

where the min and max values are taken as the 2nd and 98th percentiles.

References

Wikipedia contributors, “Radial basis function,” Wikipedia, The Free Encyclopedia, https://en.wikipedia.org/w/index.php?title=Radial_basis_function&oldid=906155047 (accessed August 19, 2019).