From a1d8e5607f3ccc9dbe867fb3fba55a086b64ec57 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 27 Oct 2023 13:44:27 +0100 Subject: [PATCH] A Start - part n --- .../serial/fixed_target/i24ssx_moveonclick.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py index 5c71e5036..924aff5f3 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py @@ -3,9 +3,11 @@ Robin Owen 12 Jan 2021 """ import logging -from typing import Dict +from typing import Dict, Tuple import cv2 as cv + +# from dodal.beamlines import i24 from dodal.devices.oav.oav_parameters import OAVParameters from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_Manager_py3v1 as manager @@ -21,16 +23,16 @@ zoomcalibrator = 6 # 8 seems to work well for zoom 2 -def get_beam_centre(oav_config: Dict[str, str] = OAV_CONFIG_FILES): +def get_beam_centre(oav_config: Dict[str, str] = OAV_CONFIG_FILES) -> Tuple[int, int]: """Extract the beam centre x/y positions from the display.configuration file. Args: - oav_config: + oav_config (dict, optional): Dictionary of file locations for oav config. """ - # I think context might be xraycentering or PinTip here, but need to double check - oav_params = OAVParameters("xrayCentring") - beamX, beamY = (oav_params.beam_centre_x, oav_params.beam_centre_y) - # etc etc + # Use xraycentering as context, not super relevant here. + oav_params = OAVParameters("xrayCentring", **oav_config) + oav_params.zoom = 1.0 + beamX, beamY = (oav_params.beam_centre_i, oav_params.beam_centre_j) return beamX, beamY