-
Notifications
You must be signed in to change notification settings - Fork 29
Rename multiplier to exposures_per_event and move to first dim of shape #726
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
Conversation
… dataset description" This reverts commit 488d7eb.
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 |
@jwlodek @coretl @genematx Please review the change of default behavior for single scalars, then we should be good to merge. Although either One final question is whether to say whether the |
Thank you, @thomashopkins32. LGTM! |
…ve-multiplier-to-first-dim
…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.
Fine to merge from what I can see, but I'll leave final approval to @jwlodek
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.
Just tested w/ two cameras, and it looks good:
In [11]: arr = tiled_client.values().last()['primary']['external']['manta-cam1'].read()
In [12]: arr.shape
Out[12]: (100, 544, 728)
In [13]: arr = tiled_client.values().last()['primary']['external']['manta-cam2'].read()
In [14]: arr.shape
Out[14]: (200, 1088, 1456)
Here had an exposures_per_event of 1 and 2 respectively, and saving into the same stream.
Going to go ahead and merge.
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