ScaledRegularGridInterpolator#

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

Bases: object

Thin wrapper around scipy.interpolate.RegularGridInterpolator.

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

Dimensions of length 1 are ignored in the interpolation of the data.

Parameters
pointstuple of ndarray or Quantity

Tuple of points passed to RegularGridInterpolator.

valuesndarray

Values passed to RegularGridInterpolator.

points_scaletuple of str

Interpolation scale used for the points.

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

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

axisint or None

Axis along which to interpolate.

method{“linear”, “nearest”}

Default interpolation method. Can be overwritten when calling the ScaledRegularGridInterpolator.

**kwargsdict

Keyword arguments passed to RegularGridInterpolator.

Methods Summary

__call__(points[, method, clip])

Interpolate data points.

Methods Documentation

__call__(points, method=None, clip=True, **kwargs)[source]#

Interpolate data points.

Parameters
pointstuple of ndarray or Quantity

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

method{None, “linear”, “nearest”}

Linear or nearest neighbour interpolation. None will choose the default defined on init.

clipbool

Clip values at zero after interpolation.