From b9b32769ca181e479c94fe217601f74a090525d0 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 11 Sep 2025 14:50:51 +0200 Subject: [PATCH] DAQ: __loop_center_sequence: now uses ml_loop_centre_box. If it does not find a target moves on --- daq/src/aaredaq/daq.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/daq/src/aaredaq/daq.py b/daq/src/aaredaq/daq.py index 37eb8393..c7989918 100644 --- a/daq/src/aaredaq/daq.py +++ b/daq/src/aaredaq/daq.py @@ -829,13 +829,22 @@ class AareDAQ: gain = int(s.sam_cam_gain) self.save_screenshot_db(sample_id, f"pre_alc_{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}") self.__devs.aerotech.move(angle, wait=True) + time.sleep(1) filename = None - exp = int(s.sam_cam_exp * 1000) - gain = int(s.sam_cam_gain) if sample_id is not None: - filename = f"{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}" + if not os.path.exists(f"{sample_id}_{s.zoom_value:.0f}"): + os.mkdir(f"{sample_id}_{s.zoom_value:.0f}") + if not os.path.exists(f"{sample_id}_{s.zoom_value:.0f}_negative"): + os.mkdir(f"{sample_id}_{s.zoom_value:.0f}_negative") + if angle > 0: + filename = f"{sample_id}_{s.zoom_value:.0f}/{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}" + else: + filename = f"{sample_id}_{s.zoom_value:.0f}_negative/{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}" - self.__devs.smargon.target = self.__loop_center(s, filename) + target = self.__ml_loop_centre_box(sample_id, filename) + if target is None: + continue + self.__devs.smargon.target = target #self.__loop_center(s, filename, iteration=i) self.__devs.smargon.wait(60) print(sample_id) if sample_id is not None: