NDDataArray

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

Bases: object

ND Data Array Base class

for usage examples see nddata_demo.ipynb

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(name) Return axis by name
evaluate([method]) Evaluate NDData Array
find_node(**kwargs) Find next node

Attributes Documentation

axes

Array holding the axes in correct order

data

Array holding the n-dimensional data.

default_interp_kwargs = {'fill_value': None, 'bounds_error': False}

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(name)[source]

Return axis by name

evaluate(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

find_node(**kwargs)[source]

Find next node

Parameters:

kwargs : dict

Keys are the axis names, Values the evaluation points