Skip to content

Commit

Permalink
Temporary read zoom level
Browse files Browse the repository at this point in the history
  • Loading branch information
noemifrisina committed Oct 27, 2023
1 parent 8b84c41 commit bba087d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import logging
from typing import Dict, Tuple

import bluesky.plan_stubs as bps
import cv2 as cv

# from dodal.beamlines import i24
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
Expand All @@ -29,9 +29,15 @@ def get_beam_centre(oav_config: Dict[str, str] = OAV_CONFIG_FILES) -> Tuple[int,
Args:
oav_config (dict, optional): Dictionary of file locations for oav config.
"""

def read_zoom_level():
oav = i24.oav()
zoom_level = yield from bps.rd(oav.zoom_controller.level)
return float(zoom_level)

Check warning on line 36 in src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py

View check run for this annotation

Codecov / codecov/patch

src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py#L33-L36

Added lines #L33 - L36 were not covered by tests

# Use xraycentering as context, not super relevant here.
oav_params = OAVParameters("xrayCentring", **oav_config)
oav_params.zoom = 1.0
oav_params.zoom = read_zoom_level()
beamX, beamY = (oav_params.beam_centre_i, oav_params.beam_centre_j)
return beamX, beamY

Check warning on line 42 in src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py

View check run for this annotation

Codecov / codecov/patch

src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py#L39-L42

Added lines #L39 - L42 were not covered by tests

Expand Down

0 comments on commit bba087d

Please sign in to comment.