diff --git a/src/mx_bluesky/beamlines/i23/__init__.py b/src/mx_bluesky/beamlines/i23/__init__.py index d6352ef10a..0a33d76351 100644 --- a/src/mx_bluesky/beamlines/i23/__init__.py +++ b/src/mx_bluesky/beamlines/i23/__init__.py @@ -1,3 +1,5 @@ +from mx_bluesky.beamlines.i23.centering import optical_centering_plan +from mx_bluesky.beamlines.i23.hello import hello from mx_bluesky.beamlines.i23.serial import serial_collection -__all__ = ["serial_collection"] +__all__ = ["serial_collection", "optical_centering_plan", "hello"] diff --git a/src/mx_bluesky/beamlines/i23/centering.py b/src/mx_bluesky/beamlines/i23/centering.py new file mode 100644 index 0000000000..fbd3ed419b --- /dev/null +++ b/src/mx_bluesky/beamlines/i23/centering.py @@ -0,0 +1,28 @@ +from bluesky.utils import MsgGenerator +from dodal.common import inject +from dodal.devices.motors import XYZOmegaStage +from dodal.devices.oav.oav_detector import OAV +from dodal.devices.oav.pin_image_recognition import PinTipDetection + +from mx_bluesky.common.experiment_plans.pin_tip_centring_plan import ( + PinTipCentringComposite, + pin_tip_centre_plan, +) + + +def optical_centering_plan( + oav: OAV = inject("OAV"), + gonio: XYZOmegaStage = inject("gonio"), + pin_tip_detection: PinTipDetection = inject("pin_tip_detection"), + tip_offset_microns: float = 0, + oav_config_file: str = "/dls/science/groups/i23/aithre/daq_configuration/json/OAVCentring.json", +) -> MsgGenerator: + """Plan to perform optical centering of the sample using the OAV pin tip detection.""" + + composite = PinTipCentringComposite(oav, gonio, pin_tip_detection) + + yield from pin_tip_centre_plan( + composite=composite, + tip_offset_microns=tip_offset_microns, + oav_config_file=oav_config_file, + ) diff --git a/src/mx_bluesky/beamlines/i23/hello.py b/src/mx_bluesky/beamlines/i23/hello.py new file mode 100644 index 0000000000..cdb80ece07 --- /dev/null +++ b/src/mx_bluesky/beamlines/i23/hello.py @@ -0,0 +1,12 @@ +import bluesky.plan_stubs as bps + +from mx_bluesky.common.utils.log import LOGGER + + +def hello(): + """Plan to log 'Hello World' to the GDA log panel via Bluesky logging.""" + LOGGER.info("Hello World from I23 Bluesky plan!") + + # Example: Read a value and log it + yield from bps.sleep(0.1) # Yield to Bluesky to keep it a valid plan + LOGGER.info("Plan completed successfully") diff --git a/uv.lock b/uv.lock index f220fb58eb..49e409d617 100644 --- a/uv.lock +++ b/uv.lock @@ -802,8 +802,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "2.2.3.dev14+g729a8b2d8" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#729a8b2d8730963455c268cb38d91bfcaa9e50be" } +version = "2.2.4.dev7+g0beeb3135" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#0beeb3135ae40248df69aa3c4d04ec43af055436" } dependencies = [ { name = "aiofiles", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "aiohttp", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },