NDDataArray

class gammapy.utils.nddata.NDDataArray(axes, data=None, meta=None, interp_kwargs=None)[source]

Bases: object

ND Data Array Base class

Parameters:
axes : list

List of DataAxis

data : Quantity

Data

meta : dict

Meta info

interp_kwargs : dict

TODO

Attributes Summary

axes Array holding the axes in correct order
data Array holding the n-dimensional data.
default_interp_kwargs Default interpolation kwargs used to initialize the scipy.interpolate.RegularGridInterpolator.
dim Dimension (number of axes)

Methods Summary

axis(self, name) Return axis by name
evaluate(self[, method]) Evaluate NDData Array

Attributes Documentation

axes

Array holding the axes in correct order

data

Array holding the n-dimensional data.

default_interp_kwargs = {'bounds_error': False, 'values_scale': 'lin'}

Default interpolation kwargs used to initialize the scipy.interpolate.RegularGridInterpolator. The interpolation behaviour of an individual axis (‘log’, ‘linear’) can be passed to the axis on initialization.

dim

Dimension (number of axes)

Methods Documentation

axis(self, name)[source]

Return axis by name

evaluate(self, method=None, **kwargs)[source]

Evaluate NDData Array

This function provides a uniform interface to several interpolators. The evaluation nodes are given as kwargs.

Currently available: RegularGridInterpolator, methods: linear, nearest

Parameters:
method : str {‘linear’, ‘nearest’}, optional

Interpolation method

kwargs : dict

Keys are the axis names, Values the evaluation points

Returns:
array : Quantity

Interpolated values, axis order is the same as for the NDData array