NDDataArray

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

Bases: object

ND Data Array Base class

Parameters
axeslist

List of DataAxis

dataQuantity

Data

metadict

Meta info

interp_kwargsdict

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
methodstr {‘linear’, ‘nearest’}, optional

Interpolation method

kwargsdict

Keys are the axis names, Values the evaluation points

Returns
arrayQuantity

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