databroker icon indicating copy to clipboard operation
databroker copied to clipboard

Projections: stream configuration output makes it difficult to map events and configuration

Open dylanmcreynolds opened this issue 3 years ago • 0 comments

Current Behavior

The Projector code in databroker supports defining an output of a stream's configuration settings.

A stream can have multiple configurations (which are items in an array). Each configuration points to a subset of the events for the stream. In the databroker api, you can map from an event to see it's associated item in the list of configurations.

Projections intentionally hide streams and configurations in their output. An example of why might be that if one beamline has a separate field for darkframes, but another stores dark frames as a certain set of events in the primary stream, the projected output could be agnostic to this fact.

However, there is currently no facility to match the configurations that might be projected to the items in any particular other field in the projection. You cannot say this device configuration maps to say array indexes 0-999 of a data array and this other configuration maps to fields 1000-1003.

Possible Solution

The design here would have to be thought through pretty carefully. The way configuration fields are represented in the projector's output xarray.Dataset already feels like an awkward fit. It is a special attribute called "configuration".

dylanmcreynolds avatar Jun 09 '21 22:06 dylanmcreynolds