In [1]:
import numpy as np
import astropy.units as u
from gammapy.data import DataStore
In [2]:
ds = DataStore.from_dir('1dc/1dc/index/agn')
In [3]:
ds.obs_table.info()
In [4]:
ds.obs_table.info('stats')
In [5]:
ds.obs_table[:20]
Out[5]:
In [6]:
ds.hdu_table.info()
In [7]:
ds.hdu_table.info('stats')
In [8]:
ds.hdu_table[:20]
Out[8]:
In [9]:
ds = DataStore.from_dir('1dc/1dc/index/all')
In [10]:
irf = ds.obs_table.to_pandas()['IRF']
In [11]:
irf.value_counts()
Out[11]:
In [12]:
irf2 = ds.hdu_table.to_pandas()
irf2 = irf2.query('HDU_TYPE == "aeff"')
irf2 = irf2['FILE_DIR'].str.split('/').apply(lambda _: _[-1])
In [13]:
irf2.value_counts()
Out[13]:
In [14]:
ds = DataStore.from_dir('1dc/1dc/index/all')
obs_ids = ds.obs_table['OBS_ID'].data[::500]
obs_ids
Out[14]:
In [15]:
for obs_id in obs_ids:
print('loading', obs_id)
obs = ds.obs(obs_id)
print('events', len(obs.events.table))
print('aeff', obs.aeff.data.data.max())
print('edisp', obs.edisp.data.data.max())
print('psf', float(obs.psf.containment_radius(energy=1*u.TeV, theta=0*u.deg).deg))
print('bkg', obs.bkg.data.data.max())
In [16]:
ds.info()
In [17]:
names = 'agn', 'gps', 'gc', 'egal', 'agn'
for name in names:
print('checking', name)
ds = DataStore.from_dir('1dc/1dc/index/' + name)
obs_id = ds.obs_table['OBS_ID']
print(np.all(np.diff(obs_id) > 0))
obs_id = ds.hdu_table['OBS_ID']
print(np.all(np.diff(obs_id) >= 0))
In [ ]: