Skip to content

Commit

Permalink
Move transmission change in rotation to after detector unstaged
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Sep 18, 2024
1 parent c1c7b55 commit 62e47db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ def rotation_scan_plan(
"scan_points": [params.scan_points],
}
)
@transmission_and_xbpm_feedback_for_collection_decorator(
composite.xbpm_feedback,
composite.attenuator,
params.transmission_frac,
)
def _rotation_scan_plan(
motion_values: RotationMotionProfile,
composite: RotationScanComposite,
Expand Down Expand Up @@ -360,6 +355,11 @@ def rotation_scan(
],
}
)
@transmission_and_xbpm_feedback_for_collection_decorator(
composite.xbpm_feedback,
composite.attenuator,
parameters.transmission_frac,
)
def rotation_scan_plan_with_stage_and_cleanup(
params: RotationScan,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from dodal.devices.oav.oav_parameters import OAVParameters
from dodal.devices.smargon import Smargon
from dodal.devices.synchrotron import SynchrotronMode
from dodal.devices.xbpm_feedback import Pause
from dodal.devices.zebra import PC_GATE, Zebra
from dodal.devices.zebra_controlled_shutter import ZebraShutterControl
from ophyd_async.core import get_mock_put
Expand Down Expand Up @@ -384,7 +385,7 @@ def test_rotation_scan_triggers_xbpm_then_pauses_xbpm_and_sets_transmission(
msgs,
lambda msg: msg.command == "set"
and msg.obj.name == "xbpm_feedback-pause_feedback"
and msg.args[0] == "Paused",
and msg.args[0] == Pause.PAUSE.value,
)
msgs = assert_message_and_return_remaining(
msgs,
Expand All @@ -394,6 +395,28 @@ def test_rotation_scan_triggers_xbpm_then_pauses_xbpm_and_sets_transmission(
)


def test_rotation_scan_does_not_change_transmission_back_until_after_data_collected(
rotation_scan_simulated_messages,
test_rotation_params: RotationScan,
):
msgs = assert_message_and_return_remaining(
rotation_scan_simulated_messages,
lambda msg: msg.command == "unstage" and msg.obj.name == "eiger",
)
msgs = assert_message_and_return_remaining(
msgs,
lambda msg: msg.command == "set"
and msg.obj.name == "xbpm_feedback-pause_feedback"
and msg.args[0] == Pause.RUN.value,
)
msgs = assert_message_and_return_remaining(
msgs,
lambda msg: msg.command == "set"
and msg.obj.name == "attenuator"
and msg.args[0] == 1.0,
)


def test_rotation_scan_moves_gonio_to_start_before_snapshots(
rotation_scan_simulated_messages,
):
Expand Down

0 comments on commit 62e47db

Please sign in to comment.