SpectrumStats

class gammapy.data.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.
from_observation_in_range(observation, …) Create from DataStoreObservation.
stack(stats_list) Stack (concatenate) list of ObservationStats.
to_dict(self) 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 from_observation_in_range(observation, bg_estimate, energy_range)[source]

Create from DataStoreObservation.

Parameters:
observation : DataStoreObservation

IACT data store observation

bg_estimate : BackgroundEstimate

Background estimate

energy_range : tuple of Quantity

minimum and maximum energy

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(self)[source]

TODO: document