Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move transmission change in rotation to after detector unstaged #504

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
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 @@ -361,6 +356,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 @@ -391,7 +392,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 @@ -401,6 +402,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
Loading