SpectrumEnergyGroupMaker

class gammapy.spectrum.SpectrumEnergyGroupMaker(obs)[source]

Bases: object

Energy bin groups for spectral analysis.

This class contains both methods that run algorithms that compute groupings as well as the results as data members and methods to debug and assess the results.

The input obs is used read-only, to access the counts energy binning, as well as some other info that is used for energy bin grouping.

Parameters:

obs : SpectrumObservation

Spectrum observation

Attributes

obs (SpectrumObservation) Spectrum observation data
groups (SpectrumEnergyGroups) List of energy groups

Methods Summary

compute_groups_fixed(ebounds) Apply grouping for a given fixed energy binning.
groups_from_obs() Compute energy groups with one group per energy bin.

Methods Documentation

compute_groups_fixed(ebounds)[source]

Apply grouping for a given fixed energy binning.

This groups the observation obs.e_reco binning and ebounds using a nearest neighbor match on the bin edges.

Parameters:

ebounds : Quantity

Energy bounds array

groups_from_obs()[source]

Compute energy groups with one group per energy bin.