From 7eed48ed26014bf79fa2fed27bfd962ab212cd64 Mon Sep 17 00:00:00 2001 From: Chish36 Date: Mon, 9 Jun 2025 14:39:06 +0100 Subject: [PATCH] Swapped the order of CSM so y axis is completed first --- .../things/camera_stage_mapping.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/camera_stage_mapping.py b/src/openflexure_microscope_server/things/camera_stage_mapping.py index 25540169..e26bf27b 100644 --- a/src/openflexure_microscope_server/things/camera_stage_mapping.py +++ b/src/openflexure_microscope_server/things/camera_stage_mapping.py @@ -228,10 +228,12 @@ class CameraStageMapper(Thing): This performs two 1d calibrations in x and y, then combines their results. """ - logger.info("Calibrating X axis:") - cal_x: dict = self.calibrate_1d(hw, stage, logger, (1, 0, 0)) + # Calibrate y-axis first as it is more likely to fail. + # The x-y difference is due to the camera aspect ratio, not the stage hardware. logger.info("Calibrating Y axis:") cal_y: dict = self.calibrate_1d(hw, stage, logger, (0, 1, 0)) + logger.info("Calibrating X axis:") + cal_x: dict = self.calibrate_1d(hw, stage, logger, (1, 0, 0)) logger.info("Calibration complete, updating metadata.") # Combine X and Y calibrations to make a 2D calibration