PhaseBackgroundMaker

class gammapy.spectrum.PhaseBackgroundMaker(on_phase, off_phase)[source]

Bases: object

Background estimation with on and off phases.

TODO: For a usage example see future notebook.

TODO: The phase interval has to be between 0 and 1. Cases like [-0.1, 0.1], for example, are still not supported.

Parameters
on_phasetuple or list of tuples

on-phase defined by the two edges of each interval (edges are excluded)

off_phasetuple or list of tuples

off-phase defined by the two edges of each interval (edges are excluded)

Methods Summary

make_counts(self, dataset, observation)

Make off counts.

make_counts_off(self, dataset, observation)

Make off counts.

run(self, dataset, observation)

Run all steps.

Methods Documentation

make_counts(self, dataset, observation)[source]

Make off counts.

Parameters
datasetSpectrumDataset

Input dataset.

observationDatastoreObservation

Data store observation.

Returns
counts_offCountsSpectrum

Off counts.

make_counts_off(self, dataset, observation)[source]

Make off counts.

Parameters
datasetSpectrumDataset

Input dataset.

observationDatastoreObservation

Data store observation.

Returns
counts_offCountsSpectrum

Off counts.

run(self, dataset, observation)[source]

Run all steps.

Parameters
datasetSpectrumDataset

Input dataset.

observationDataStoreObservation

Data store observation.

Returns
dataset_on_offSpectrumDatasetOnOff

On off dataset.