-
Notifications
You must be signed in to change notification settings - Fork 28
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 frames_per_event and move to first dim of shape #726
base: main
Are you sure you want to change the base?
Rename multiplier to frames_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.
Question about shapes when frames_per_event
is 1: do we want to always "squeeze" the shape?
I.e. there are a couple of options:
- For 2d arrays:
[1, h, w]
->[h, w]
whenframes_per_event = 1
[frames_per_event, h, w]
whenframes_per_event > 1
- For scalar values:
[1,]
->[]
whenframes_per_event = 1
[frames_per_event,]
whenframes_per_event > 1
Currently, it is set up such that if the result would be a single scalar value, the shape would be replaced with []
. Otherwise, the shape always contains the extra 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.
I think this is close, just a few minor notes. We should try setting this up in the lab and running a test w/ collecting data from different devices w/ different frames_per_event
to make sure it behaves as expected (and also to maybe work out the needed changes to the consolidators).
I think I'd be in favor of avoiding such squeezing, because then we'd need a separate parameter to let us know if it had been squeezed or not. Say we have a frames_per_event of 1 w/ a dataset that's 10 x 10. If we squeeze we get [10, 10] as the shape, but there's no way of telling if this is actually a 1D dataset of size 10 w/ 10 frames per event. |
@jwlodek so the current squeezing behavior for the shape is
The final change I would make based on your comment would be to remove the squeezing on scalar values from [1,] -> []. |
Should be ready to review once more. The new shape behavior is such that the |
@jwlodek, @jennmald , and I did some testing on actual devices and found a few more issues that need to be resolved. We didn't get through all of the testing we planned for so we will continue next week most likely. For ophyd-async (completed in a5b1f27) :
For bluesky:
For tiled:
That covers pretty much everything that we tested a debugged on the devices so far. We will see if changes to tiled are necessary in further testing. |
I'm not sure, I don't think that's a real restriction. If you remove it, what breaks? |
Nothing actually, we removed it and got everything to work as expected, just into separate streams. We're going to make sure they can fit into the same stream this week |
…ts frames_per_event > 1
…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.
We've now tested this and it is working for us, pending the Consolidator
PR.
Actually we decided that it does not work well with tiled just yet. We want tiled to have the Basically, ophyd-async has the descriptor shape with the first dim as The shape of the data from the user perspective should always be |
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