Summary
The focus of this demo is to show the user how to use the "external clock triggers" feature in DIRSIG. Rather than use a "constant" clock that triggers at some rate (in Hertz), this feature allows the user to supply a list of trigger times.
Details
The external or user-defined clock trigger feature is a way for the user to describe a clock sequence that is irregular and cannot be modeled with the standard regular (periodic) clock options. This mechanism is useful for modeling a clock that might have some variability (e.g., it is not exactly a 20 kHz clock) or a clock that drops (skips) a trigger once in a while. Rather than model these sorts of clocks with statistical descriptors, the option uses a data-driven approach. The user can provide a time sequence that captures the desired clock tick sequence. If the sequence is N seconds long and the simulation requires some multiple of that duration, the supplied sequence is looped (repeated) to span the duration.
Important Files
Scene
The scene is the simple scene containing that resembles a clock. There is a "hand" on the clock that rotates through a 360 degree sweep over the course of 1 second (or a rotational rate of 1 Hz). In addition, there is a fixed "hand" and a small pole in the middle of the clock face casting a shadow.
Platform
The platform contains a single camera with a small 128 x 128 array that is placed directly over the clock scene. There are two simulation setups provided:
Constant Clock
The constant.sim
scenario collects images at 10 Hz. This allows the user
to see the "hand" smoothly sweep out a full rotation.
External Clock
The triggers.sim
scenario collects images at the times supplied in the
triggers.txt
file.
triggers.txt
file.0.00 0.10 0.20 0.50 0.75 1.00
The times in the external trigger file are in seconds relative to the simulation reference time. The user can supply as many times as they like. This file is referenced in the clock setup for the one focal plane in the platform file.
Important
|
DIRSIG currently sorts all capture events based on time. If the user provides a list of trigger times that are not already sorted, the user should expect those times to be sorted. That means the trigger time #N in the trigger file might not be capture #N if the times were out of order. |
This file only defines 1 second of data, but the simulation spans 2 seconds. After the sequence is exhausted at 1 second, DIRSIG will loop (repeat) the sequence to span the collection duration.
Important
|
When the sequence is looped, if the first time is 0
it is skipped on the looped iterations because repeating
it would result in a capture that is 0 seconds after the
last capture in the sequence, which effectively duplicates
the last trigger time.
|
Setup
Both the regular (constant) and irregular (non-constant) readout simulations use the same tasks file, which defines a collection that lasts 2 seconds. The difference is that in once case the array is read out regularly (periodically) and in the other it is read out irregularly.
Regular Interval Simulation
Running the constant.sim
file will produce 20 output image files
because the capture method is configured to output "files per capture".
The 20 frames results from 2 seconds x 10 frames/second.

Irregular Interval Simulation
Running the triggers.sim
file will produce 11 output image files
because the capture method is configured to output "files per capture".
The 11 frames results from the 6 times in the user-supplied sequence
being looped once and the 0
time being skipped on the second loop.
The trigger times were selected to have irregular intervals but to
correspond to easily recognizable positions on the clock face.
