ScaledRegularGridInterpolator

class gammapy.utils.interpolation.ScaledRegularGridInterpolator(points, values, values_scale='lin', extrapolate=True, **kwargs)[source]

Bases: object

Thin wrapper around scipy.interpolate.RegularGridInterpolator.

The values are scaled before the interpolation and back-scaled after the interpolation.

Parameters:

points : tuple

Tuple of points passed to RegularGridInterpolator.

values :

Values passed to RegularGridInterpolator.

values_scale : {‘lin’, ‘log’, ‘sqrt’}

Interpolation scaling applied to values. If the values vary over many magnitudes a ‘log’ scaling is recommended.

**kwargs : dict

Keyword arguments passed to RegularGridInterpolator.

Methods Summary

__call__(points[, method, clip]) Interpolate data points.

Methods Documentation

__call__(points, method='linear', clip=True, **kwargs)[source]

Interpolate data points.

Parameters:

points : tuple of np.ndarray

Tuple of coordinate arrays of the form (x_1, x_2, x_3, …). Arrays are broadcasted internally.

method : {“linear”, “nearest”}

Linear or nearest neighbour interpolation.

clip : bool

Clip values at zero after interpolation.