We are about to write StreamResource/StreamDatum support for Odin. Odin supports frames being written in a round robin fashion between N writers, and writers that produce each M files for a particular acquisition by automatically advancing when a certain number of frames are written. We have 4 options to expose this:
- Produce NxM StreamResource documents, one for every file that every writer produces, and add the concept of step to a StreamRange so that StreamDatum contiguous indices map to every Nth seq_num. Requires significant rework to bluesky bundlers.
- Produce M StreamResource documents, one for set of N files that the writers produce, parameterizing the uri with a writer number, and adding the number of writers and round robin strategy StreamResource document to allow the consolidator to work out which of the N files the frame lives in
- Produce one StreamResource document, with uri parameterized on writer number and file number, with number of writers, number of frames per file and round robin strategy in the StreamResource document
- We write a VDS encoding this information, and make the StreamResource point at that, but still include the parameters from 3 in case we need to do direct chunk read from the underlying datasets
We decided to do 4.
The parameters for the StreamResource should be a key virtual_dataset with members:
source_file_template: a parameterized string with {writer_number} and {file_number} in it that gives the filename for the given writer number and file number (0 indexed)
source_dataset: the dataset within the source file to read from
number_of_writers: the number of writers writing files
events_per_file: the maximum number of events in each file (of the shape given in the descriptor, i.e. could be multiple frames)
events_per_writer: the number of sequential events that will be written to a single writer before moving onto the next one
The algorithm for picking the parameters to get the right file is:
writer_number = (event_number // events_per_writer) % number_of_writers
file_number = (event_number // number_of_writers) // events_per_file
Acceptance Criteria
- VDS created from Odin
StreamResource created by the Odin ophyd-async support that points at the VDS
- ADR written with the above
We are about to write StreamResource/StreamDatum support for Odin. Odin supports frames being written in a round robin fashion between N writers, and writers that produce each M files for a particular acquisition by automatically advancing when a certain number of frames are written. We have 4 options to expose this:
We decided to do 4.
The parameters for the
StreamResourceshould be a keyvirtual_datasetwith members:source_file_template: a parameterized string with{writer_number}and{file_number}in it that gives the filename for the given writer number and file number (0 indexed)source_dataset: the dataset within the source file to read fromnumber_of_writers: the number of writers writing filesevents_per_file: the maximum number of events in each file (of the shape given in the descriptor, i.e. could be multiple frames)events_per_writer: the number of sequential events that will be written to a single writer before moving onto the next oneThe algorithm for picking the parameters to get the right file is:
Acceptance Criteria
StreamResourcecreated by the Odin ophyd-async support that points at the VDS