From 1468a1211c853a885a8157861c93d5f29b1ae2ba Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 14 Jul 2025 10:36:28 +0200 Subject: [PATCH] DAQ: tries to create ml_bounding_box, if it fails moves to 90 degrees and updates file_prefix. --- daq/src/aaredaq/daq.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/daq/src/aaredaq/daq.py b/daq/src/aaredaq/daq.py index 6d78e214..f50d53cf 100644 --- a/daq/src/aaredaq/daq.py +++ b/daq/src/aaredaq/daq.py @@ -339,9 +339,13 @@ class AareDAQ: if sample is None: raise Exception("Sample must be mounted to auto center") - self.__devs.aerotech.move(grid.omega_deg, wait=True) old_prefix = grid.file_prefix - r = self.__ml_bounding_box(sample.db_id, grid.file_prefix) + geom = self.sample_geometry + r = self.__ml_bounding_box(sample.db_id, f"{old_prefix}_ml_{geom.omega_deg}deg") + if r is None: + self.__devs.aerotech.move(geom.omega_deg + 90.0, wait=True) + time.sleep(0.2) + r = self.__ml_bounding_box(sample.db_id, f"{old_prefix}_ml_{geom.omega_deg + 90.0}deg") if r is not None: geom = self.sample_geometry grid.smargon = r.smargon