SpectrumDatasetMaker#
- class gammapy.makers.SpectrumDatasetMaker(selection=None, containment_correction=False, background_oversampling=None, use_region_center=True)[source]#
Bases:
gammapy.makers.map.MapDatasetMaker
Make spectrum for a single IACT observation.
The IRFs and background are computed at a single fixed offset, which is recommended only for point-sources.
- Parameters
- selectionlist of str, optional
Select which maps to make, the available options are: ‘counts’, ‘exposure’, ‘background’, ‘edisp’. By default, all maps are made.
- containment_correctionbool
Apply containment correction for point sources and circular on regions.
- background_oversamplingint
Background evaluation oversampling factor in energy.
- use_region_centerbool
If True, approximate the IRFs by the value at the center of the region. If False, the IRFs are averaged over the entire.
Attributes Summary
Methods Summary
make_background
(geom, observation)Make background map.
make_counts
(geom, observation)Make counts map.
make_edisp
(geom, observation)Make energy dispersion map.
make_edisp_kernel
(geom, observation)Make energy dispersion kernel map.
make_exposure
(geom, observation)Make exposure.
make_exposure_irf
(geom, observation[, ...])Make exposure map with IRF geometry.
make_meta_table
(observation)Make information meta table.
make_psf
(geom, observation)Make PSF map.
run
(dataset, observation)Make spectrum dataset.
Attributes Documentation
- available_selection = ['counts', 'background', 'exposure', 'edisp']#
- tag = 'SpectrumDatasetMaker'#
Methods Documentation
- make_background(geom, observation)#
Make background map.
- Parameters
- geom
Geom
Reference geometry.
- observation
Observation
Observation container.
- geom
- Returns
- background
Map
Background map.
- background
- static make_counts(geom, observation)[source]#
Make counts map.
If the
RegionGeom
is built from aCircleSkyRegion
, the latter will be directly used to extract the counts. If instead theRegionGeom
is built from aPointSkyRegion
, the size of the ON region is taken from theRAD_MAX_2D
table containing energy-dependent theta2 cuts.- Parameters
- geom
Geom
Reference map geometry.
- observation
Observation
Observation container.
- geom
- Returns
- counts
RegionNDMap
Counts map.
- counts
- make_edisp(geom, observation)#
Make energy dispersion map.
- Parameters
- geom
Geom
Reference geometry.
- observation
Observation
Observation container.
- geom
- Returns
- edisp
EDispMap
Energy dispersion map.
- edisp
- make_edisp_kernel(geom, observation)#
Make energy dispersion kernel map.
- Parameters
- geom
Geom
Reference geometry. Must contain “energy” and “energy_true” axes in that order.
- observation
Observation
Observation container.
- geom
- Returns
- edisp
EDispKernelMap
Energy dispersion kernel map.
- edisp
- make_exposure(geom, observation)[source]#
Make exposure.
- Parameters
- geom
RegionGeom
Reference map geometry.
- observation
Observation
Observation to compute effective area for.
- geom
- Returns
- exposure
RegionNDMap
Exposure map.
- exposure
- static make_exposure_irf(geom, observation, use_region_center=True)#
Make exposure map with IRF geometry.
- Parameters
- geom
Geom
Reference geometry.
- observation
Observation
Observation container.
- use_region_centerbool, optional
For geom as a
RegionGeom
. If True, consider the values at the region center. If False, average over the whole region. Default is True.
- geom
- Returns
- exposure
Map
Exposure map.
- exposure
- static make_meta_table(observation)#
Make information meta table.
- Parameters
- observation
Observation
Observation.
- observation
- Returns
- meta_table
Table
Meta table.
- meta_table
- make_psf(geom, observation)#
Make PSF map.
- Parameters
- geom
Geom
Reference geometry.
- observation
Observation
Observation container.
- geom
- Returns
- psf
PSFMap
PSF map.
- psf
- run(dataset, observation)[source]#
Make spectrum dataset.
- Parameters
- dataset
SpectrumDataset
Reference dataset.
- observation
Observation
Observation.
- dataset
- Returns
- dataset
SpectrumDataset
Spectrum dataset.
- dataset