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

available_selection

tag

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
geomGeom

Reference geometry.

observationObservation

Observation container.

Returns
backgroundMap

Background map.

static make_counts(geom, observation)[source]#

Make counts map.

If the RegionGeom is built from a CircleSkyRegion, the latter will be directly used to extract the counts. If instead the RegionGeom is built from a PointSkyRegion, the size of the ON region is taken from the RAD_MAX_2D table containing energy-dependent theta2 cuts.

Parameters
geomGeom

Reference map geometry.

observationObservation

Observation container.

Returns
countsRegionNDMap

Counts map.

make_edisp(geom, observation)#

Make energy dispersion map.

Parameters
geomGeom

Reference geometry.

observationObservation

Observation container.

Returns
edispEDispMap

Energy dispersion map.

make_edisp_kernel(geom, observation)#

Make energy dispersion kernel map.

Parameters
geomGeom

Reference geometry. Must contain “energy” and “energy_true” axes in that order.

observationObservation

Observation container.

Returns
edispEDispKernelMap

Energy dispersion kernel map.

make_exposure(geom, observation)[source]#

Make exposure.

Parameters
geomRegionGeom

Reference map geometry.

observationObservation

Observation to compute effective area for.

Returns
exposureRegionNDMap

Exposure map.

static make_exposure_irf(geom, observation, use_region_center=True)#

Make exposure map with IRF geometry.

Parameters
geomGeom

Reference geometry.

observationObservation

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.

Returns
exposureMap

Exposure map.

static make_meta_table(observation)#

Make information meta table.

Parameters
observationObservation

Observation.

Returns
meta_tableTable

Meta table.

make_psf(geom, observation)#

Make PSF map.

Parameters
geomGeom

Reference geometry.

observationObservation

Observation container.

Returns
psfPSFMap

PSF map.

run(dataset, observation)[source]#

Make spectrum dataset.

Parameters
datasetSpectrumDataset

Reference dataset.

observationObservation

Observation.

Returns
datasetSpectrumDataset

Spectrum dataset.