SpectrumStats

class gammapy.spectrum.SpectrumStats(**kwargs)[source]

Bases: gammapy.data.ObservationStats

Spectrum stats.

Extends ObservationStats with spectrum specific information (energy bin info at the moment).

Attributes Summary

alpha Alpha (on / off exposure ratio)
background Background estimate (float)
excess Excess (float)
sigma Li-Ma significance for observation statistics (float).

Methods Summary

from_observation(observation, bg_estimate) Create from DataStoreObservation.
stack(stats_list) Stack (concatenate) list of ObservationStats.
to_dict() TODO: document

Attributes Documentation

alpha

Alpha (on / off exposure ratio)

Override member function from Stats to take into account weighted alpha by number of Off events

background

Background estimate (float)

\[\mu_\mathrm{bg} = \alpha\ n_\mathrm{off}\]
excess

Excess (float)

\[n_\mathrm{ex} = n_\mathrm{on} - \mu_\mathrm{bg}\]
sigma

Li-Ma significance for observation statistics (float).

Methods Documentation

classmethod from_observation(observation, bg_estimate)

Create from DataStoreObservation.

Parameters:
observation : DataStoreObservation

IACT data store observation

bg_estimate : BackgroundEstimate

Background estimate

classmethod stack(stats_list)

Stack (concatenate) list of ObservationStats.

Parameters:
stats_list : list

List of ObservationStats

Returns:
total_stats : ObservationStats

Statistics for stacked observation

to_dict()[source]

TODO: document