This commit is contained in:
2026-02-25 14:30:03 +01:00
parent 09ea513aad
commit 80ec3da039

View File

@@ -331,9 +331,6 @@ class AmorEventData(AmorHeader):
Read the actual event data from file. If file is too large, find event index from packets
that allow splitting of file smaller than self.max_events.
"""
if self.hdf['/entry1/Amor/detector/data/event_index'].shape[0]==0:
raise EOFError(f'No event packet found starting at event #{self.first_index}, '
f'number of events is 0')
packets = np.recarray(self.hdf['/entry1/Amor/detector/data/event_index'].shape, dtype=PACKET_TYPE)
packets.start_index = self.hdf['/entry1/Amor/detector/data/event_index'][:]
packets.time = self.hdf['/entry1/Amor/detector/data/event_time_zero'][:]
@@ -344,6 +341,9 @@ class AmorEventData(AmorHeader):
raise EOFError(f'No event packet found starting at event #{self.first_index}, '
f'number of events is {self.hdf["/entry1/Amor/detector/data/event_time_offset"].shape[0]}')
packets = packets[start_packet:]
if packets.shape[0]==0:
raise EOFError(f'No event packet found starting at event #{self.first_index}, '
f'number of packets is 0')
nevts = self.hdf['/entry1/Amor/detector/data/event_time_offset'].shape[0]
if (nevts-self.first_index)>self.max_events: