ParametrizedNearestNeighborSearcher

class pyirf.interpolation.ParametrizedNearestNeighborSearcher(grid_points, params, norm_ord=2)[source]

Bases: BaseNearestNeighborSearcher

Dummy NearestNeighbor approach usable instead of actual interpolation/extrapolation Compatible with parametrized IRF component API.

Methods Summary

__call__(target_point)

Providing a common __call__ interface

interpolate(target_point)

Takes a grid of IRF values for a bunch of different parameters and returns the values at the nearest grid point as seen from the target point.

Methods Documentation

__call__(target_point)

Providing a common __call__ interface

Parameters:
target_point: np.ndarray, shape=(1, n_dims)

Target for inter-/extrapolation When target_point is outside of the grids convex hull but extrapolator is None

Returns:
Interpolated result.
interpolate(target_point)

Takes a grid of IRF values for a bunch of different parameters and returns the values at the nearest grid point as seen from the target point.

Parameters:
target_point: numpy.ndarray, shape=(1, n_dims)

Value for which the nearest neighbor should be found (target point)

Returns:
content_new: numpy.ndarray, shape=(1, …)

values at nearest neighbor

Notes

In case of multiple nearest neighbors, the values corresponding to the first one are returned.