From 34045e45060f5de9c49a266da62a4fa241f18cef Mon Sep 17 00:00:00 2001
From: Runner PC Cavity Lab <johannes.schabbauer@tuwien.ac.at>
Date: Tue, 3 Sep 2024 15:39:22 +0200
Subject: [PATCH] Bubfix

---
 ADwinProII/blacs_workers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ADwinProII/blacs_workers.py b/ADwinProII/blacs_workers.py
index dcde962..8271e02 100644
--- a/ADwinProII/blacs_workers.py
+++ b/ADwinProII/blacs_workers.py
@@ -114,7 +114,7 @@ class ADwinProIIWorker(Worker):
         stop_time_quantized = np.round(self.stop_time * CLOCK_T12 / self.PROCESSDELAY)
         AO_data = group["ANALOG_OUT/VALUES"]
         final_indices = np.nonzero(AO_data["n_cycles"] == stop_time_quantized)[0]
-        if final_indices[-1]+1==AO_data.shape[0]:
+        if final_indices.size>0 and final_indices[-1]+1==AO_data.shape[0]:
             # In the ANALOG_OUT table, there is a termination line. The time (cycle number) of this line
             # should be one larger than the last outputs, but sometimes this seemed to be violated. I added
             # this check to remove this line in any of those cases from trying to use it for final values.
-- 
GitLab