%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from gammapy.data import EventList
plt.style.use('ggplot')
url = 'https://github.com/gammapy/gammapy-extra/raw/master/datasets/hess-crab4/hess_events_simulated_023523.fits'
events = EventList.read(url)
Downloading https://github.com/gammapy/gammapy-extra/raw/master/datasets/hess-crab4/hess_events_simulated_023523.fits [Done]
WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect] WARNING:astropy:hdu= was not specified but multiple tables are present, reading in first available table (hdu=1)
time = events['TIME']
dt = time[1:] - time[:-1]
x = dt[:-1]
y = dt[1:]
plt.scatter(x, y)
plt.xlim(1e-3, x.max())
plt.ylim(1e-3, y.max())
plt.xlabel('Time before event')
plt.ylabel('Time after event')
plt.loglog()
[]
len(x)
1525