Update examples/test_spectrum_energy_group.py
@@ -8,20 +8,16 @@ warnings.filterwarnings('ignore')
filename = '$GAMMAPY_EXTRA/datasets/hess-crab4_pha/pha_obs23523.fits'
obs = SpectrumObservation.read(filename)
-table = obs.stats_table()
seg = SpectrumEnergyGroupMaker(obs=obs)
ebounds = [0.03, 1, 3, 10, 30] * u.TeV
-seg.compute_range_safe()
seg.compute_groups_fixed(ebounds=ebounds)
print('\nTable of original energy bins:')
-seg.table[['energy_group_idx', 'bin_idx', 'energy_min', 'energy_max']].pprint(max_lines=-1)
+obs.stats_table()[['energy_min', 'energy_max']].pprint(max_lines=-1)
print('\nTable of grouped energy bins:')
seg.groups.to_group_table().pprint(max_lines=-1)
-print('\nTable of grouped energy bins:')
+print('\nTable of total energy bins:')
seg.groups.to_total_table().pprint(max_lines=-1)
-
-print(seg)
