LogEnergyAxis¶
-
class
gammapy.spectrum.LogEnergyAxis(energy, mode='center')[source]¶ Bases:
objectLog energy axis.
Defines a transformation between:
energy = 10 ** xx = log10(energy)pixin the range [0, …, len(x)] via linear interpolation of thexarray, e.g.pix=0corresponds tox[0]andpix=0.3is0.5 * (0.3 * x[0] + 0.7 * x[1])
Note
The specutils.Spectrum1DLookupWCS class is similar (only that it doesn’t include the
logtransformation and the API is different. Also see this Astropy feature request: https://github.com/astropy/astropy/issues/2362Parameters: energy :
QuantityEnergy 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