-
Notifications
You must be signed in to change notification settings - Fork 4
Optionally use fastcs eiger for XRC #1436
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
base: main
Are you sure you want to change the base?
Changes from all commits
99d68e7
c20bf93
924072f
cd75065
c133bf9
2d74d14
66cc98a
bf2b514
74835fd
c658f29
9ca327c
49416b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| ) | ||
| from dodal.log import LOGGER | ||
| from dodal.plan_stubs.check_topup import check_topup_and_wait_if_necessary | ||
| from ophyd_async.fastcs.eiger import EigerDetector as FastCSEiger | ||
| from scanspec.core import AxesPoints, Axis | ||
|
|
||
| from mx_bluesky.common.experiment_plans.inner_plans.read_hardware import ( | ||
|
|
@@ -28,12 +29,16 @@ | |
|
|
||
| def _wait_for_zocalo_to_stage_then_do_fgs( | ||
| grid_scan_device: FastGridScanCommon, | ||
| detector: EigerDetector, | ||
| detector: EigerDetector | FastCSEiger, | ||
| synchrotron: Synchrotron, | ||
| during_collection_plan: Callable[[], MsgGenerator] | None = None, | ||
| ): | ||
| expected_images = yield from bps.rd(grid_scan_device.expected_images) | ||
| exposure_sec_per_image = yield from bps.rd(detector.cam.acquire_time) # type: ignore # Fix types in ophyd-async (https://github.com/DiamondLightSource/mx-bluesky/issues/855) | ||
| exposure_sec_per_image = yield from ( | ||
| bps.rd(detector.cam.acquire_time) | ||
| if isinstance(detector, EigerDetector) # old eiger | ||
| else bps.rd(detector.drv.detector.frame_time) # fastcs eiger | ||
| ) | ||
| LOGGER.info("waiting for topup if necessary...") | ||
| yield from check_topup_and_wait_if_necessary( | ||
| synchrotron, | ||
|
|
@@ -66,7 +71,8 @@ def _wait_for_zocalo_to_stage_then_do_fgs( | |
|
|
||
| def kickoff_and_complete_gridscan( | ||
| gridscan: FastGridScanCommon, | ||
| detector: EigerDetector, # Once Eiger inherits from StandardDetector, use that type instead | ||
| detector: EigerDetector | ||
| | FastCSEiger, # use StandardDetector once old eiger not in use | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can actually use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's good to know, could we just use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well theoretically any standard detector which writes using odin could do the XRC plan, but I doubt we'll be doing this anytime soon. So yeah, can just use |
||
| synchrotron: Synchrotron, | ||
| scan_points: list[AxesPoints[Axis]], | ||
| plan_during_collection: Callable[[], MsgGenerator] | None = None, | ||
|
|
@@ -103,7 +109,11 @@ def kickoff_and_complete_gridscan( | |
| ) | ||
| @bpp.contingency_decorator( | ||
| except_plan=lambda e: (yield from bps.stop(detector)), # type: ignore # Fix types in ophyd-async (https://github.com/DiamondLightSource/mx-bluesky/issues/855) | ||
| else_plan=lambda: (yield from bps.unstage(detector, wait=True)), | ||
| else_plan=lambda: ( | ||
| yield from bps.unstage(detector, wait=True) # old eiger | ||
| if isinstance(detector, EigerDetector) | ||
| else bps.complete(detector, wait=True) # fastcs eiger | ||
| ), | ||
| ) | ||
| def _decorated_do_fgs(): | ||
| yield from _wait_for_zocalo_to_stage_then_do_fgs( | ||
|
|
||
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.
The old eiger device waits for frames when we unstage. The fast-cs eiger will just immediately disarm on unstage.
For the fast-cs eiger we need to do
yield from bps.completeinstead - this will wait for frames with a default timeout, or the timeout specified inTriggerInfoThere 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.
Good spot, thanks