EffectiveAreaTable2D¶
-
class
gammapy.irf.
EffectiveAreaTable2D
(energy_lo, energy_hi, offset_lo, offset_hi, data, meta=None, interp_kwargs=None)[source]¶ Bases:
object
2D effective area table.
Data format specification: AEFF_2D
Parameters: Examples
Here’s an example you can use to learn about this class:
>>> from gammapy.irf import EffectiveAreaTable2D >>> filename = '$GAMMAPY_DATA/cta-1dc/caldb/data/cta/1dc/bcf/South_z20_50h/irf_file.fits' >>> aeff = EffectiveAreaTable2D.read(filename, hdu='EFFECTIVE AREA') >>> print(aeff) EffectiveAreaTable2D NDDataArray summary info energy : size = 42, min = 0.014 TeV, max = 177.828 TeV offset : size = 6, min = 0.500 deg, max = 5.500 deg Data : size = 252, min = 0.000 m2, max = 5371581.000 m2
Here’s another one, created from scratch, without reading a file:
>>> from gammapy.irf import EffectiveAreaTable2D >>> import astropy.units as u >>> import numpy as np >>> energy = np.logspace(0,1,11) * u.TeV >>> offset = np.linspace(0,1,4) * u.deg >>> data = np.ones(shape=(10,3)) * u.cm * u.cm >>> aeff = EffectiveAreaTable2D(energy_lo=energy[:-1], energy_hi=energy[1:], offset_lo=offset[:-1], >>> offset_hi=offset[1:], data= data) >>> print(aeff) Data array summary info energy : size = 11, min = 1.000 TeV, max = 10.000 TeV offset : size = 4, min = 0.000 deg, max = 1.000 deg Data : size = 30, min = 1.000 cm2, max = 1.000 cm2
Attributes Summary
default_interp_kwargs
Default Interpolation kwargs for NDDataArray
.high_threshold
High energy threshold low_threshold
Low energy threshold Methods Summary
from_hdulist
(hdulist[, hdu])Create from HDUList
.from_table
(table)Read from Table
.peek
(self[, figsize])Quick-look summary plots. plot
(self[, ax, add_cbar])Plot effective area image. plot_energy_dependence
(self[, ax, offset, …])Plot effective area versus energy for a given offset. plot_offset_dependence
(self[, ax, offset, …])Plot effective area versus offset for a given energy. read
(filename[, hdu])Read from file. to_effective_area_table
(self, offset[, energy])Evaluate at a given offset and return EffectiveAreaTable
.to_fits
(self[, name])Convert to BinTable
.to_table
(self)Convert to Table
.Attributes Documentation
-
default_interp_kwargs
= {'bounds_error': False, 'fill_value': None}¶ Default Interpolation kwargs for
NDDataArray
. Extrapolate.
-
high_threshold
¶ High energy threshold
-
low_threshold
¶ Low energy threshold
Methods Documentation
-
plot_energy_dependence
(self, ax=None, offset=None, energy=None, **kwargs)[source]¶ Plot effective area versus energy for a given offset.
Parameters: Returns: - ax :
Axes
Axis
- ax :
-
plot_offset_dependence
(self, ax=None, offset=None, energy=None, **kwargs)[source]¶ Plot effective area versus offset for a given energy.
Parameters: Returns: - ax :
Axes
Axis
- ax :
-
to_effective_area_table
(self, offset, energy=None)[source]¶ Evaluate at a given offset and return
EffectiveAreaTable
.Parameters:
-