fix case when beam monitor does not exist
Unit Testing / test (3.11) (push) Successful in 50s
Unit Testing / test (3.10) (push) Successful in 54s
Unit Testing / test (3.8) (push) Successful in 50s
Unit Testing / test (3.12) (push) Successful in 54s
Unit Testing / test (3.9) (push) Successful in 55s

This commit is contained in:
2026-07-09 09:30:47 +02:00
parent cf1e7d3d72
commit 228e2e87db
+6 -1
View File
@@ -553,6 +553,8 @@ class AmorEventData(AmorHeader):
return proton_current
def read_beam_monitor_stream(self, packets):
if self._beam_monitor is None:
return None
_signal = self._beam_monitor.signal
_time = self._beam_monitor.time
plse = np.array([0, 5, 6, 11])
@@ -599,7 +601,10 @@ class AmorEventData(AmorHeader):
new_events = np.concatenate([self.data.events, other.data.events]).view(np.recarray)
new_pulses = self.concatenate_dropmissing(self.data.pulses, other.data.pulses)
new_proton_current = np.concatenate([self.data.proton_current, other.data.proton_current]).view(np.recarray)
new_beam_monitor = np.concatenate([self.data.beam_monitor, other.data.beam_monitor]).view(np.recarray)
if self.data.beam_monitor is None or other.data.beam_monitor is None:
new_beam_monitor = None
else:
new_beam_monitor = np.concatenate([self.data.beam_monitor, other.data.beam_monitor]).view(np.recarray)
new_packets = np.concatenate([self.data.packets, other.data.packets]).view(np.recarray)
new_packets.start_index[self.data.packets.shape[0]:] += self.data.events.shape[0]
self.data = AmorEventStream(new_events, new_packets, new_pulses, new_proton_current, new_beam_monitor)