From 22749f18d69c89ec5bd8f7337462cccbf417346d Mon Sep 17 00:00:00 2001 From: appleb_m Date: Tue, 30 Jun 2026 14:54:18 +0200 Subject: [PATCH] Enable screening mode for rotation scans and improve logging/debug messages in rotation and raster services. --- src/aare/daq/operations/raster/service.py | 4 ++-- src/aare/daq/operations/rotation/service.py | 3 +++ src/aare/gui/panels/rotation_data_collection.py | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aare/daq/operations/raster/service.py b/src/aare/daq/operations/raster/service.py index 2cec37c7..d7096a8d 100644 --- a/src/aare/daq/operations/raster/service.py +++ b/src/aare/daq/operations/raster/service.py @@ -9,7 +9,7 @@ from jfjoch_client.exceptions import NotFoundException from aare.common.coordinate import AerotechCoordinate, Coordinate, SmargonCoordinate from aare.common.exception_handler import AutoRasterSampleSkipped, RasterScanException from aare.common.find_xtal import raster_highest_score, get_xtal_size, get_best_res, \ - get_best_b_factor + get_best_b_factor, compute_crystal_score_array from aare.common.logger_events import ( geom_log_context, log_ml_bundle_meta, @@ -613,7 +613,7 @@ class RasterService: }, ), ) - self.ctx.deps.cfg.crystal_size = get_xtal_size(self.ctx.deps.cfg.crystal_size, result_array, r=request) + self.ctx.deps.cfg.crystal_size = get_xtal_size(self.ctx.deps.cfg.crystal_size, compute_crystal_score_array(scan_result.images), r=request) self.ctx.deps.cfg.last_best_res = get_best_res(result_list= scan_result.images) self.ctx.deps.cfg.last_best_b_factor = get_best_b_factor(result_list=scan_result.images) return CompletedRasterGridElem( diff --git a/src/aare/daq/operations/rotation/service.py b/src/aare/daq/operations/rotation/service.py index 7b4c855b..51816169 100644 --- a/src/aare/daq/operations/rotation/service.py +++ b/src/aare/daq/operations/rotation/service.py @@ -47,6 +47,7 @@ class RotationService: self.ctx.deps.devs.set_dtz(request.dtz, wait=True) if request.screening: + self.logger.debug(f"Starting screening scan with {request.steps} steps") self.ctx.deps.devs.aerotech.screening_scan( rotation_deg=request.steps * request.incr_omega_deg, wedge_deg=request.wedge_omega_deg, @@ -55,6 +56,7 @@ class RotationService: run_async=True, ) else: + self.logger.debug(f"Starting rotation scan with {request.steps} steps") self.ctx.deps.devs.aerotech.rotation_scan( rotation_deg=request.steps * request.incr_omega_deg, time_sec=total_time, @@ -156,6 +158,7 @@ class RotationService: # For screening runs, ingest the per-wedge diffraction images. Done # before the COLLECTED event so they pin to the same sample event the # run is bound to (the COLLECTING event), matching the preview above. + self.logger.debug(f"Ingesting screening diffraction images: {request.screening}") if request.screening and not self.ctx.deps.cfg.simulated_detector: self._ingest_screening_diffraction(sample, result.result) diff --git a/src/aare/gui/panels/rotation_data_collection.py b/src/aare/gui/panels/rotation_data_collection.py index b26b477e..7f32e858 100644 --- a/src/aare/gui/panels/rotation_data_collection.py +++ b/src/aare/gui/panels/rotation_data_collection.py @@ -150,10 +150,11 @@ class RotationDataCollectionPanel(ScanSettingsPanel): file_prefix=str(add_screening_to_path(self._filename)), start_omega_deg=self.start_angle.value, incr_omega_deg=self.screening_image_angle.value, + wedge_omega_deg=screening_settings["omega_step_deg"], steps=1, dtz=self._dtz, transmission=self._transmission, - screening=False, + screening=True, exp_time_s=self.screening_image_time_enter.value, ) else: