SpectrumDatasetMaker#

class gammapy.makers.SpectrumDatasetMaker[source]#

Bases: 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_counts(geom, observation)

Make counts map.

make_exposure(geom, observation)

Make exposure.

run(dataset, observation)

Make spectrum dataset.

Attributes Documentation

available_selection = ['counts', 'background', 'exposure', 'edisp']#
tag = 'SpectrumDatasetMaker'#

Methods Documentation

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_exposure(geom, observation)[source]#

Make exposure.

Parameters:
geomRegionGeom

Reference map geometry.

observationObservation

Observation to compute effective area for.

Returns:
exposureRegionNDMap

Exposure map.

run(dataset, observation)[source]#

Make spectrum dataset.

Parameters:
datasetSpectrumDataset

Reference dataset.

observationObservation

Observation.

Returns:
datasetSpectrumDataset

Spectrum dataset.

__init__(selection=None, containment_correction=False, background_oversampling=None, use_region_center=True)[source]#
classmethod __new__(*args, **kwargs)#