From 96681c8f815161fae79095ba0596e5a0bfcd76e6 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Tue, 28 Jan 2025 16:17:48 +0100 Subject: [PATCH] fix case where there is no pulse missing --- libeos/file_reader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libeos/file_reader.py b/libeos/file_reader.py index d336b41..351678d 100644 --- a/libeos/file_reader.py +++ b/libeos/file_reader.py @@ -252,6 +252,10 @@ class AmorData: pulseExtra = (pulseLengths-np.int64(self.tau*1e9))//np.int64(self.tau*2e9) gap_indices = np.where(pulseExtra>0)[0] + if len(gap_indices)==0: + # no missing pulses, just use given array + self.pulseTimeS = np.array(pulseTime, dtype=np.int64) + return self.pulseTimeS = np.array(pulseTime[:gap_indices[0]+1], dtype=np.int64) last_index = gap_indices[0] for gapi in gap_indices[1:]: