SpectrumDatasetMaker

class gammapy.spectrum.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

geom_ref(region)

Reference geometry to project region

make_aeff(self, region, energy_axis_true, …)

Make effective area.

make_background(region, energy_axis, observation)

Make background.

make_counts(self, region, energy_axis, …)

Make counts.

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

static geom_ref(region)[source]

Reference geometry to project region

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.DataStoreObservation`

Observation to compute effective area for.

Returns
aeffEffectiveAreaTable

Effective area table.

static make_background(region, energy_axis, observation)[source]

Make background.

Parameters
regionSkyRegion

Region to compute background spectrum for.

energy_axisMapAxis

Reconstructed energy axis.

observation: `~gammapy.data.DataStoreObservation`

Observation to compute effective area for.

Returns
backgroundCountsSpectrum

Background spectrum

make_counts(self, region, energy_axis, observation)[source]

Make counts.

Parameters
regionSkyRegion

Region to compute counts spectrum for.

energy_axisMapAxis

Reconstructed energy axis.

observation: `~gammapy.data.DataStoreObservation`

Observation to compute effective area for.

Returns
countsCountsSpectrum

Counts spectrum

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.DataStoreObservation`

Observation to compute edisp for.

Returns
edispEnergyDispersion

Energy dispersion

run(self, dataset, observation)[source]

Make spectrum dataset.

Parameters
datasetSpectrumDataset

Spectrum dataset.

observation: `~gammapy.data.DataStoreObservation`

Observation to reduce.

Returns
datasetSpectrumDataset

Spectrum dataset.