-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add fly scan plan stub #293
Conversation
c270f9d
to
f9e8cf0
Compare
src/ophyd_async/planstubs/fly.py
Outdated
from ophyd_async.panda._trigger import SeqTableInfo | ||
|
||
|
||
def fly_and_collect( |
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.
This should probably have a more specific name.
Something like time_resolved_trigger_detectors
?
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.
I agree, I just wanted to call it something and figured i'd ask for opinions before merging.
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.
Perhaps rewording your suggestion to improve clarity? Not sure what it should be though.
Requires:
Test script: # Import bluesky and ophyd
import bluesky.plans as bp
import bluesky.preprocessors as bpp
from bluesky import RunEngine
from bluesky.utils import ProgressBarManager, register_transform
from dodal.beamlines import p45
from dodal.beamlines.beamline_utils import set_directory_provider
from ophyd_async.core import HardwareTriggeredFlyable, StaticDirectoryProvider
from ophyd_async.panda._trigger import StaticSeqTableTriggerLogic
from ophyd_async.planstubs import fly_and_collect
# Create a run engine, with plotting, progressbar and transform
RE = RunEngine({}, call_returns_result=True)
RE.waiting_hook = ProgressBarManager()
register_transform("RE", prefix="<")
# Create ophyd-async devices
set_directory_provider(StaticDirectoryProvider("/dls/p45/data/2024/cm37283-2/tmp"))
det = p45.diff()
panda = p45.panda1()
flyer = HardwareTriggeredFlyable(StaticSeqTableTriggerLogic(panda.seq[1]))
@bpp.stage_decorator([panda, det])
@bpp.run_decorator()
def my_custom_plan():
yield from fly_and_collect(
"primary", [panda, det], flyer, 10, 0.1, 0.5, repeats=2, period=1
)
RE(my_custom_plan(), lambda n, d: print(n, d)) |
The existing code treated 0 == None, so would fetch the current index if index=0, rather than producing StreamDatum up to index 0 as intended
@coretl I have had to change the |
I have also had to change back the |
I have also dropped the patch to 90% as it was up at 98 and was starting to get prohibitive. This will not effect the catching of overall coverage. |
Made an issue to investgate the stub. #329 |
Fixes #278.
This adds a plan stub for the current fly scanning flow we have. That being:
This does the middle three points, so all you should need to do outside this is instantiate devices, stage and open a run.