From ccd36f7bf8899b953a983ae7d4317ba28defde58 Mon Sep 17 00:00:00 2001 From: appel_c Date: Mon, 15 Jun 2026 14:01:33 +0200 Subject: [PATCH] fix: cont_grid scan fixes --- csaxs_bec/scans/scans_v4/cont_grid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/scans/scans_v4/cont_grid.py b/csaxs_bec/scans/scans_v4/cont_grid.py index 290fc79..ecd1439 100644 --- a/csaxs_bec/scans/scans_v4/cont_grid.py +++ b/csaxs_bec/scans/scans_v4/cont_grid.py @@ -195,13 +195,16 @@ class ContGrid(ScanBase): self._cont_motor_params["num_lines"] = int( np.ceil(np.abs(self.stepper_stop - self.stepper_start) / self.stepper_step_size) ) - self.positions = position_generators.nd_grid_positions( + positions = position_generators.nd_grid_positions( [ (self.stepper_start, self.stepper_stop, self._cont_motor_params["num_lines"]), (self.fast_start, self.fast_end, frames_per_trigger), ], snaked=False, ) + # Count only the end point of each line as a valid position, as the fast axis is continuously moving and only triggered at + # the beginning of the line moving to the end point. + self.positions = positions[(frames_per_trigger - 1) :: frames_per_trigger, :] # Get device specific parameters self._fetch_device_params() @@ -223,6 +226,7 @@ class ContGrid(ScanBase): positions=self.positions, num_points=len(self.positions), frames_per_trigger=frames_per_trigger, + computed_positions=positions, ) self.actions.add_scan_report_instruction_device_progress(self.mcs)