From 2a54ee43d3240eb1427e7bfbbf01ebc1fedc392b Mon Sep 17 00:00:00 2001 From: appleb_m Date: Mon, 22 Dec 2025 09:33:26 +0100 Subject: [PATCH] DAQ: added error handling for raster if spots less than a thresh-hold. Currently commented as it affects manual users, should only be used in automation. --- daq/src/aaredaq/daq.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/daq/src/aaredaq/daq.py b/daq/src/aaredaq/daq.py index 2854e0a5..5c162cb7 100644 --- a/daq/src/aaredaq/daq.py +++ b/daq/src/aaredaq/daq.py @@ -614,6 +614,19 @@ class AareDAQ: result_array = create_quality_filtered_array(images, 'spots_low_res', min_spots=None, min_efficiency=1.0, min_background=None, min_low_res_spots=None) + result_array = create_quality_filtered_array(images, + 'spots_low_res', min_spots=None, + min_efficiency=1.0, min_background=None, + min_low_res_spots=None) + + #if not has_sufficient_low_res_spots(result_array, self.MIN_SPOTS_LOW_RES_THRESHOLD): + # logger.error("Auto X-ray centering failed: insufficient low-resolution spots " + # f"(threshold={self.MIN_SPOTS_LOW_RES_THRESHOLD})") + # self.__aare.ingest_gridscan(sample=self.sample, raster_result=result, + # raster_request=r, geom=self.sample_geometry, + # com=None, beam_mark_pxl=self.__cfg.get_beam_mark(self.zoom)) + # raise AXCFailed("Auto X-ray centering failed: insufficient low-resolution spots") + self.__cfg.crystal_size = get_xtal_size(self.__cfg.crystal_size, result_array, r) com = raster_centre_of_mass(result_array, images) if com is None: