pyinterp.core.RTree3DFloat64.value#

RTree3DFloat64.value(self: pyinterp.core.RTree3DFloat64, coordinates: numpy.ndarray[numpy.float64], radius: float | None = None, k: int = 4, within: bool = False, num_threads: int = 0) tuple#

Get the K nearest neighbors of a given point.

Parameters:
  • coordinates – a matrix (n, 3) where n is the number of observations and 3 is the number of coordinates in order: longitude and latitude in degrees and altitude in meters. If the shape of the matrix is (n, 2) then the method considers the altitude constant and equal to zero.

  • radius – The maximum radius of the search (m). By default, no limit is applied.

  • k – The number of nearest neighbors to be used for calculating the interpolated value. Defaults to 4.

  • within – If true, the method ensures that the neighbors found are located around the point of interest. Defaults to false.

  • 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:

A tuple of matrices containing the coordinates and values of the different neighbors found for all provided positions.

Note

The matrix containing the coordinates of the neighbors is a matrix of dimension (k, n) where n is equal to 2 if the provided coordinates matrix defines only longitude and latitude, and 3 if the defines longitude, latitude and altitude.