SpectrumDatasetMaker

class gammapy.makers.SpectrumDatasetMaker(containment_correction=False, selection=None)[source]

Bases: object

Make spectrum for a single IACT observation.

The irfs and background are computed at a single fixed offset, which is recommend only for point-sources.

Parameters
containment_correctionbool

Apply containment correction for point sources and circular on regions.

selectionlist

List of str, selecting which maps to make. Available: ‘counts’, ‘aeff’, ‘background’, ‘edisp’ By default, all spectra are made.

Attributes Summary

available_selection

Methods Summary

make_aeff(self, region, energy_axis_true, …)

Make effective area.

make_background(geom, observation)

Make background.

make_counts(geom, observation)

Make counts map.

make_edisp(position, energy_axis, …)

Make energy dispersion.

run(self, dataset, observation)

Make spectrum dataset.

Attributes Documentation

available_selection = ['counts', 'background', 'aeff', 'edisp']

Methods Documentation

make_aeff(self, region, energy_axis_true, observation)[source]

Make effective area.

Parameters
regionSkyRegion

Region to compute background effective area.

energy_axis_trueMapAxis

True energy axis.

observation: `~gammapy.data.Observation`

Observation to compute effective area for.

Returns
aeffEffectiveAreaTable

Effective area table.

static make_background(geom, observation)[source]

Make background.

Parameters
geomRegionGeom

Reference map geom.

observation: `~gammapy.data.Observation`

Observation to compute effective area for.

Returns
backgroundRegionNDMap

Background spectrum

static make_counts(geom, observation)[source]

Make counts map.

Parameters
geomRegionGeom

Reference map geom.

observationObservation

Observation container.

Returns
countsRegionNDMap

Counts map.

static make_edisp(position, energy_axis, energy_axis_true, observation)[source]

Make energy dispersion.

Parameters
positionSkyCoord

Position to compute energy dispersion for.

energy_axisMapAxis

Reconstructed energy axis.

energy_axis_trueMapAxis

True energy axis.

observation: `~gammapy.data.Observation`

Observation to compute edisp for.

Returns
edispEDispKernel

Energy dispersion

run(self, dataset, observation)[source]

Make spectrum dataset.

Parameters
datasetSpectrumDataset

Spectrum dataset.

observation: `~gammapy.data.Observation`

Observation to reduce.

Returns
datasetSpectrumDataset

Spectrum dataset.