Hi, @dchabot, @klauer,
I have been looking at 2 issues. 1 Time-stamping of data and secondly triggering detectors. Currently in the run_engine it is only possible to trigger a single EpicsSignal
(it uses the put method). This doesn't allow the nice new detector classes to be used such as EpicsScaler
or the area detector zoo.
I wonder if it is time to start thinking about adding a trigger()
method to these type of detectors which could be called by the run_engine. I would also suggest at this time having a trigger_timestamp
property which is the timestamp of the trigger. Even EpicsSignals
could have this which would just do a self.put(1)
. Thoughts?
I am also starting to think about timestamps. It appears that we have 2 different type of detectors. Those that require triggering and have been done so in a step scan. We also have things that get added to the run which are asynchronous. It would appear that we need to distinguish between these two. I think that an event
should always have a timestamp and contain only data which was at that timestamp, with the caveat that software triggers still group them together in one event descriptor.
I would propose the following:
We have 3 types of event:
- In a step scan there is always a trigger event, taken from the system clock which is executed just before ophyd starts triggering and at the end of reading detectors. This event would look like:
trigger {
start : (float of start from time.time())
stop : (float of stop)
}
This is useful in data collection because it is the execution window of the step scan.
For detectors that are triggered, they are grouped into a single event descriptor which would look like:
detector_group_1 {
pos1 : (value of motor)
sclr_1 : (scalar channel 1)
...
timestamp : (earliest trigger value)
}
The timestamp would be taken from the minimum value of the trigger timestamps (there is no good way to do this.
Lastly, EpicsSignals
which are not triggered are recorded as separate events with there own timestamp:
temp_a {
temp_a : (value)
timestamp : (earliest trigger value)
}
I think this could be achieved with a little config. This pushes some work onto the data side but provides the truest representation of what actually happened without having each detector have a single event. I don't know if @tacaswell, @ericdill or @danielballan think this is what we discussed at length yesterday.
Also, this could be configurable, with the option to just record each detector as its own event as an advanced option.
While this may not be the long term goal of the run_engine. I wonder if this could be tested (I would be happy to implement a test branch) so that we can see how this runs and what the pitfalls on the data collection side are. Thoughts?