From 0ac948746ab6fc0367ff9c5db2a22879b6f425f7 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Fri, 26 Jun 2026 10:08:18 +0200 Subject: [PATCH] raster auto-center: make vertical line-scan Y padding configurable The 2nd-stage vertical line scan (n_x=1, height from the ML box) padded its height by a hardcoded 0.10 each side (20% total), which was often too short to cover the whole loop. Read the per-side fraction from daq.auto_raster.line_scan_y_padding_fraction (default 0.15) so it can be tuned per beamline. Co-Authored-By: Claude Opus 4.8 --- src/aare/common/config/x06da.yaml | 1 + src/aare/daq/operations/raster/service.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aare/common/config/x06da.yaml b/src/aare/common/config/x06da.yaml index 95d8bbaa..fb8136e2 100644 --- a/src/aare/common/config/x06da.yaml +++ b/src/aare/common/config/x06da.yaml @@ -56,3 +56,4 @@ daq: auto_raster: loop_face_padding_fraction: 0.15 # pad loop_face raster boxes by 15% per side include_crystal: false # extend the grid to cover crystals outside the loop box + line_scan_y_padding_fraction: 0.15 # pad the 2nd-stage vertical line scan height by this per side (10-20%) diff --git a/src/aare/daq/operations/raster/service.py b/src/aare/daq/operations/raster/service.py index 2496abd0..a6ae69a9 100644 --- a/src/aare/daq/operations/raster/service.py +++ b/src/aare/daq/operations/raster/service.py @@ -213,7 +213,7 @@ class RasterService: grid_size_mm: Coordinate, default_n_y: int = 50, y_retarget_threshold_mm: float | None = None, - y_padding_fraction_each_side: float = 0.10, + y_padding_fraction_each_side: float = 0.15, ) -> tuple[SmargonCoordinate, int]: geom = self.ctx.sample_geometry beam_x_pxl = geom.beam_location_pxl.x @@ -799,7 +799,9 @@ class RasterService: geom.beam_size_mm.y * 2.0, grid.grid_size_mm.y * 4.0, ), - y_padding_fraction_each_side=0.10, + y_padding_fraction_each_side=float( + cfg_get("daq.auto_raster.line_scan_y_padding_fraction", 0.15) + ), ) self.logger.info(