Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7e0f0a1
add transmission percentage
srishtysajeev Sep 15, 2025
86444ff
add transmission
srishtysajeev Sep 15, 2025
6cb556b
add transmission - for real
srishtysajeev Sep 15, 2025
d7211d7
attempt at shutter task
srishtysajeev Sep 15, 2025
743d1c7
Update devcontainer.json
olliesilvester Sep 16, 2025
4e0f3d1
Bring in vscode settings to devcontainer
olliesilvester Sep 16, 2025
f08a8f4
test commit
olliesilvester Sep 16, 2025
9aa3b17
Update getting started docs
olliesilvester Sep 16, 2025
2cba2d7
Fix typos on docs
olliesilvester Sep 16, 2025
6997fb6
Fix docs CI
olliesilvester Sep 16, 2025
8651e07
add OAV image plan
srishtysajeev Sep 16, 2025
b9f19b6
Add dodal dev dependencies to devcontainer
olliesilvester Sep 16, 2025
c91adca
Get dlstbx working in devcontainer
olliesilvester Sep 16, 2025
bc9a54a
Merge branch '1265_fix_devcontainer_new' into 1259_test_OAV_plans
srishtysajeev Sep 17, 2025
0894d53
Resolve linting issues
srishtysajeev Sep 22, 2025
4e2ef1d
start adding scintillator
srishtysajeev Sep 22, 2025
4a9ee24
Add injects and add beam feedback check and add scintillator
srishtysajeev Sep 22, 2025
e7f131d
Add imports to __init__.py
srishtysajeev Sep 22, 2025
3350ba2
Change according to Dom's comments - with wait = True or use mv instead
srishtysajeev Sep 23, 2025
9ea1359
Merge branch 'main' into 1259_test_OAV_plans
srishtysajeev Sep 23, 2025
a016677
Merge branch '1259_test_OAV_plans' of github.com:DiamondLightSource/m…
srishtysajeev Sep 23, 2025
8a461bc
hotfixes from beamline
srishtysajeev Sep 23, 2025
fce5453
fix lint checks
srishtysajeev Sep 23, 2025
50ff42d
test
srishtysajeev Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/mx_bluesky/beamlines/i04/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from mx_bluesky.beamlines.i04.experiment_plans.i04_grid_detect_then_xray_centre_plan import (
i04_grid_detect_then_xray_centre,
)
from mx_bluesky.beamlines.i04.test_plans.oav_automation import (
feedback_check,
move_scintillator,
open_close_fast_shutter,
set_transmission_percentage,
take_OAV_image,
)
from mx_bluesky.beamlines.i04.thawing_plan import (
thaw,
thaw_and_murko_centre,
Expand All @@ -12,4 +19,11 @@
"thaw_and_stream_to_redis",
"i04_grid_detect_then_xray_centre",
"thaw_and_murko_centre",
"feedback_check",
"move_scintillator",
"open_close_fast_shutter",
"set_transmission_percentage",
"take_OAV_image",
]

# testing my git script
15 changes: 15 additions & 0 deletions src/mx_bluesky/beamlines/i04/test_plans/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from mx_bluesky.beamlines.i04.test_plans.oav_automation import (
feedback_check,
move_scintillator,
open_close_fast_shutter,
set_transmission_percentage,
take_OAV_image,
)

__all__ = [
"feedback_check",
"move_scintillator",
"open_close_fast_shutter",
"set_transmission_percentage",
"take_OAV_image",
]
66 changes: 66 additions & 0 deletions src/mx_bluesky/beamlines/i04/test_plans/oav_automation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import bluesky.plan_stubs as bps
from bluesky.utils import MsgGenerator
from dodal.common import inject
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
from dodal.devices.oav.oav_detector import OAV
from dodal.devices.scintillator import InOut, Scintillator
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra_controlled_shutter import (
ZebraShutter,
ZebraShutterControl,
ZebraShutterState,
)

# from dodal.devices.oav.snapshots.snapshot_with_grid import SnapshotWithGrid

"""
My task:
Move the scintillator in and out
Change transmission percentage
Take OAV images
Open and close fast shutter
"""


# def oav_automation_test()
def feedback_check(
feedback: XBPMFeedback = inject("xbpm_feedback"),
):
yield from bps.trigger(feedback, wait=True)


def set_transmission_percentage(
percentage: float,
attenuator: BinaryFilterAttenuator = inject("attenuator"),
) -> MsgGenerator:
yield from bps.mv(attenuator, percentage / 100)


def open_close_fast_shutter(
shutter_state: ZebraShutterState,
shutter: ZebraShutter = inject("sample_shutter"),
) -> MsgGenerator:
base_control_mode = yield from bps.rd(shutter.control_mode)

yield from bps.abs_set(shutter.control_mode, ZebraShutterControl.MANUAL, wait=True)
yield from bps.abs_set(shutter, shutter_state, wait=True)

yield from bps.abs_set(shutter.control_mode, base_control_mode, wait=True)


def take_OAV_image(
file_path: str,
file_name: str,
oav: OAV = inject("oav"),
) -> MsgGenerator:
group = "path setting"
yield from bps.abs_set(oav.snapshot.filename, file_name, group=group)
yield from bps.abs_set(oav.snapshot.directory, file_path, group=group)
yield from bps.wait(group)
Comment on lines +56 to +59

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: You can use mv to change multiple things at the same time if you want:

Suggested change
group = "path setting"
yield from bps.abs_set(oav.grid_snapshot.filename, file_name, group=group)
yield from bps.abs_set(oav.grid_snapshot.directory, file_path, group=group)
yield from bps.wait(group)
yield from bps.mv(oav.grid_snapshot.filename, file_name, oav.grid_snapshot.directory, file_path)

yield from bps.trigger(oav.snapshot, wait=True)


def move_scintillator(
scintillator_state: InOut, scintillator: Scintillator = inject("scintillator")
) -> MsgGenerator:
yield from bps.mv(scintillator.selected_pos, scintillator_state)
Loading