-
Notifications
You must be signed in to change notification settings - Fork 29
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
Rename multiplier to exposures_per_event and move to first dim of shape #726
base: main
Are you sure you want to change the base?
Rename multiplier to exposures_per_event and move to first dim of shape #726
Conversation
… dataset description" This reverts commit 488d7eb.
This might seem like overkill but please help me check my understanding of the terms. Here is what I understand:
The trigger_info = TriggerInfo(number_of_triggers=4, frames_per_event=2)
RE(bps.prepare(det, trigger_info))
RE(bp.count([det], num=10)) This example currently fails to run without error. Is this something that should be possible? I can't even tell what the expected behavior here should be... This may be an unintended consequence of doing a step scan versus a fly scan but I need to dig a bit further. Either way, if there is a real issue here, it should probably be handled in a separate PR. |
My take:
Definitely. There are 3 terms here:
So
This should error with something like "Can only trigger() to contribute to a single event, but detector was prepared with number_of_events=4" |
@coretl Okay I understand now. It makes sense that a step scan can only have 1 trigger, by your definition of trigger. However, the term "trigger" seems overloaded with bluesky's definition in the sense that a I will do the renaming part in this PR and add checks + expected functionality (with tests) in another PR. |
I agree with @coretl 's understanding. One thing I thought of however when mulling this over, is that currently we are missing one thing when operating in step scan mode - namely that if I set I think the easiest solution to this would be to add a property to Thoughts? |
How about we make
I'm not sure whether |
I think this should be handled in a different PR. There is some complexity in doing this. Something like this is already done for the We would basically be doing the following:
So if someone re-uses a |
* add use/set switch (bluesky#780) * add use/set switch * rename to set_use_switch * Remove functions from ADHDFWriter that are exact copies of superclass functions (bluesky#782) * Simpler fix standard det (bluesky#784) * Make sure the capture/arm status coro hasn't already completed before trying to await it * add offset mode switch and other missing motor fields (bluesky#783) * add offset mode switch * add other things in epics motor present in ophyd-sync * remove homf,homr,movn,tdir and make signal names consistent with ophyd * make HLS and LLS int * Testing some ideas * Renamed number_of_triggers -> number_of_events, frames_per_event -> exposures_per_event * Cleanup on expected test failure * Use FailedStatus in test --------- Co-authored-by: Jack Harper <[email protected]> Co-authored-by: Jakub Wlodek <[email protected]>
…mashopkins32/ophyd-async into move-multiplier-to-first-dim
…ve-multiplier-to-first-dim
Agreed.
I think I've got some terminology confused. In my mind we're mapping:
As defined in https://areadetector.github.io/areaDetector/ADCore/ADDriver.html All of those fields in
I think I made a mistake in the current implementation, the passed in TriggerInfo should be immutable and we make a copy with a different deadtime. That would stop any surprises when a |
My understanding of the
Agreed! I think this would be great.
Yes currently it modifies the existing |
…ve-multiplier-to-first-dim
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.
Tested w/ the sister bluesky PR, in a variety of cases, and they all seem to work. @coretl OK to merge?
…ve-multiplier-to-first-dim
Just discussed in the collab call, and there was widespread concern about what else might break when these descriptors change from |
This PR does the following:
multiplier
->frames_per_event
frames_per_event
as the first dimension ofDataKey.shape
DetectorWriter.get_indices_written()
andDetectorWriter.observe_indices_written()
is divided byframes_per_event
so that it actually captures the correct amount of exposures in each index (except for PandA which explicitly says it only has 1 "frame" per event)Add unit tests showing that stream resources are actually batches of exposuresself._writer.open()
andself._writer.get_indices_written()
. The writer needs to be opened in order to get the indices written. Otherwise, it has no idea whatframes_per_event
to use when returning the index last written.I could not actually add tests using bluesky plans and inspecting the data afterword because
TriggerInfo
is hardcoded inStandardDetector
. I think it is a separate issue that should be raised since it would enhance the scope of this PR. I will open an issue for this soon and mention it below.Otherwise, I have a few open questions regarding my understanding of ophyd-async as well as the implementation which I will also leave as review comments. Please see below.
Closes #576
Closes #431