EffectiveAreaTable2D¶
-
class
gammapy.irf.EffectiveAreaTable2D(energy_axis_true, offset_axis, data, meta=None, interp_kwargs=None)[source]¶ Bases:
object2D effective area table.
Data format specification: AEFF_2D
- Parameters
- energy_axis_true
MapAxis True energy axis
- offset_axis
MapAxis Field of view offset axis.
- data
Quantity Effective area
- energy_axis_true
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 Interpolation kwargs for
NDDataArray.High energy threshold
Low energy threshold
Methods Summary
from_hdulist(hdulist[, hdu])Create from
HDUList.from_table(table)Read from
Table.peek([figsize])Quick-look summary plots.
plot([ax, add_cbar])Plot effective area image.
plot_energy_dependence([ax, offset, energy])Plot effective area versus energy for a given offset.
plot_offset_dependence([ax, offset, energy])Plot effective area versus offset for a given energy.
read(filename[, hdu])Read from file.
to_effective_area_table(offset[, energy])Evaluate at a given offset and return
EffectiveAreaTable.to_table()Convert to
Table.to_table_hdu([name])Convert to
BinTableHDU.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
-
tag= 'aeff_2d'¶
Methods Documentation
-
plot_energy_dependence(ax=None, offset=None, energy=None, **kwargs)[source]¶ Plot effective area versus energy for a given offset.
-
plot_offset_dependence(ax=None, offset=None, energy=None, **kwargs)[source]¶ Plot effective area versus offset for a given energy.
-
to_effective_area_table(offset, energy=None)[source]¶ Evaluate at a given offset and return
EffectiveAreaTable.
-
to_table_hdu(name='EFFECTIVE AREA')[source]¶ Convert to
BinTableHDU.