pyinterp.RTree.radial_basis_function#
- RTree.radial_basis_function(coordinates: ndarray, radius: float | None = None, k: int = 9, rbf: str | None = None, epsilon: float | None = None, smooth: float = 0, within: bool = True, num_threads: int = 0) Tuple[ndarray, ndarray] [source]#
Interpolation of the value at the requested position by radial basis function interpolation.
- Parameters:
coordinates – a matrix
(n, ndims)
wheren
is the number of observations andndims
is the number of coordinates in order: longitude and latitude in degrees, altitude in meters. If ndims is equal to 2 then the altitude is considered to be constant and equal to zero.radius – The maximum radius of the search (m). Defaults The maximum distance between two points.
k – The number of nearest neighbors to be used for calculating the interpolated value. Defaults to
9
.rbf –
The radial basis function, based on the radius, \(r\) given by the distance between points. This parameter can take one of the following values:
cubic
: \(\varphi(r) = r^3\)gaussian
: \(\varphi(r) = e^{-(\dfrac{r} {\varepsilon})^2}\)inverse_multiquadric
: \(\varphi(r) = \dfrac{1} {\sqrt{1+(\dfrac{r}{\varepsilon})^2}}\)linear
: \(\varphi(r) = r\)multiquadric
: \(\varphi(r) = \sqrt{1+( \dfrac{r}{\varepsilon})^2}\)thin_plate
: \(\varphi(r) = r^2 \ln(r)\)
Default to
multiquadric
epsilon – adjustable constant for gaussian or multiquadrics functions. Default to the average distance between nodes.
smooth – values greater than zero increase the smoothness of the approximation. Default to 0 (interpolation).
within – If true, the method ensures that the neighbors found are located around the point of interest. In other words, this parameter ensures that the calculated values will not be extrapolated. Defaults to
true
.num_threads – The number of threads to use for the computation. If 0 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. Defaults to
0
.
- Returns:
The interpolated value and the number of neighbors used in the calculation.