added two new properties to the event list to extract the starting and ending time of the observation
@@ -146,6 +146,16 @@ class EventListBase(object):
met = Quantity(self.table['TIME'].astype('float64'), 'second')
return self.time_ref + met
+ @property
+ def observation_time_start(self):
+ """Observation start time (`~astropy.time.Time`)."""
+ return self.time_ref + Quantity(self.table.meta['TSTART'], 'second')
+
+ @property
+ def observation_time_end(self):
+ """Observation stop time (`~astropy.time.Time`)."""
+ return self.time_ref + Quantity(self.table.meta['TSTOP'], 'second')
+
@property
def radec(self):
"""Event RA / DEC sky coordinates (`~astropy.coordinates.SkyCoord`).
@@ -683,7 +693,6 @@ class EventList(EventListBase):
mask &= (offset < offset_band[1])
return self.select_row_subset(mask)
-
def peek(self):
"""Summary plots."""
import matplotlib.pyplot as plt
@@ -840,6 +849,7 @@ class EventListLAT(EventListBase):
counts_image.fill_events(self)
counts_image.show()
+
class EventListDataset(object):
"""Event list dataset (event list plus some extra info).
