Continuous acquisition trigger mixin with circular buffer #1240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Adds a continuous acquisition trigger mixin class that allows for easy integration with area detectors cameras.
Motivation
Area detectors typically can be run in a few modes: single, multiple, or continuous acquisition. In single acquisition mode, detectors capture a single image. In multiple mode, detectors capture multiple images. Acquisition stops once the desired number of images is reached. This behavior is covered in Ophyd by
TriggerBase
(and relevant subclasses). Continuous acquisition mode captures images continuously, never terminating the underlying control system's acquisition thread.There are a few benefits to running the camera in continuous acquisition mode:
How it works
This class utilizes a subset of the functionality provided by the
NDPluginCircularBuff
EPICS area detector plugin to buffer frames for a software trigger. The size of the buffer, the "pre-count", is set to0
in our implementation to ensure that the most recent frame is the one that is always captured. Triggering the plugin releases from the buffer a number of frames specified by the "post count".The
NDCircularBuffTriggerStatus
tracks the "post-count quantity" and compares it to the target "post-count".How it was tested
This was tested using ADSim. I set up the plugins as:
so that we can test file writing from triggering the circular buffer.
Notes
I think there may be a bug with the
NDPluginCircularBuff
plugin implementation when setting the "pre-count" > 0. When used in tandem with the HDF5 plugin, it was always writing one more frame than desired which was strange to me.Other changes
Refactors the
ADTriggerStatus
to utilize a base classTriggerStatus
as to not duplicate code.