LogEnergyAxis¶
-
class
gammapy.spectrum.
LogEnergyAxis
(energy, mode='center')[source]¶ Bases:
object
Log energy axis.
Defines a transformation between:
energy = 10 ** x
x = log10(energy)
pix
in the range [0, ..., len(x)] via linear interpolation of thex
array, e.g.pix=0
corresponds tox[0]
andpix=0.3
is0.5 * (0.3 * x[0] + 0.7 * x[1])
Note
The specutils.Spectrum1DLookupWCS class is similar (only that it doesn’t include the
log
transformation and the API is different. Also see this Astropy feature request: https://github.com/astropy/astropy/issues/2362Parameters: energy :
Quantity
Energy array
mode : [‘center’, ‘edges’]
Whether the energy array represents the values at the center or edges of the pixels.
Methods Summary
wcs_pix2world
(z)Convert pixel to energy coordinates. wcs_world2pix
(energy)Convert energy to pixel coordinates. Methods Documentation