-
Notifications
You must be signed in to change notification settings - Fork 5
1259 test oav plans #1292
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
Closed
Closed
1259 test oav plans #1292
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7e0f0a1
add transmission percentage
srishtysajeev 86444ff
add transmission
srishtysajeev 6cb556b
add transmission - for real
srishtysajeev d7211d7
attempt at shutter task
srishtysajeev 743d1c7
Update devcontainer.json
olliesilvester 4e0f3d1
Bring in vscode settings to devcontainer
olliesilvester f08a8f4
test commit
olliesilvester 9aa3b17
Update getting started docs
olliesilvester 2cba2d7
Fix typos on docs
olliesilvester 6997fb6
Fix docs CI
olliesilvester 8651e07
add OAV image plan
srishtysajeev b9f19b6
Add dodal dev dependencies to devcontainer
olliesilvester c91adca
Get dlstbx working in devcontainer
olliesilvester bc9a54a
Merge branch '1265_fix_devcontainer_new' into 1259_test_OAV_plans
srishtysajeev 0894d53
Resolve linting issues
srishtysajeev 4e2ef1d
start adding scintillator
srishtysajeev 4a9ee24
Add injects and add beam feedback check and add scintillator
srishtysajeev e7f131d
Add imports to __init__.py
srishtysajeev 3350ba2
Change according to Dom's comments - with wait = True or use mv instead
srishtysajeev 9ea1359
Merge branch 'main' into 1259_test_OAV_plans
srishtysajeev a016677
Merge branch '1259_test_OAV_plans' of github.com:DiamondLightSource/m…
srishtysajeev 8a461bc
hotfixes from beamline
srishtysajeev fce5453
fix lint checks
srishtysajeev 50ff42d
test
srishtysajeev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| 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) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: You can use
mvto change multiple things at the same time if you want: