|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Jun-18-2026: this script is deprecated as it works with the now-removed WIB2 frames
Usage:
This script simply takes a list of HDF5 files produced by the DAQ (globs of course would work on the command line), loops over their records (whether trigger records or timeslices) and performs a few sanity checks. The output of the script when run on one file looks something like the following:
Concerning the progression of record ids and sequence ids: the script will look at the change in record id and sequence id between the first and second records in the file, and extrapolate that as the normal step size. If this step size is violated, then the full list of id values gets printed; otherwise simple one-sentence summaries such as you see above get printed.
Concerning the table: each row corresponds to a fragment type found in at least one record in the file. The first and second columns tell you the fewest instances of such a fragment found in a single record, and the most. Of course, these are typically the same value. The third and fourth columns tell you what the smallest and largest examples of this fragment were in the entire file. The fifth and sixth columns tell you the fewest instances of a fragment with a nonzero set of error bits, and the most, in a single record. Of course for these last two columns you'd ideally see all 0's.
There are fast unpackers of data for working in python. These unpackers will take a Fragment and put the resulting values (ADCs or timestamps) in a numpy array with shape (number of frames, number of channels) at a similar speed compared to doing that in C++. This is much faster than doing a similar thing frame by frame in a loop in python.
To use it import the functions first:
where <format> is one of the supported formats: wibeth, tde, daphneeth, or daphne for the corresponding WIBEthFrame, TDEEthFrame, DAPHNEEthFrame and DAPHNEFrame frame formats. Then there are several functions available:
np_array_adc and np_array_timestamp will unpack the whole fragment. It is also possible to unpack only a part of it:
Warning: np_array_adc_data and np_array_timestamp_data do not make any checks on the number of frames so if passed a value larger than the actual number of frames in the fragment it will try to read out of bounds. np_array_adc and np_array_timestamp call np_array_adc_data and np_array_timestamp_data under the hood with the correct checks on the number of frames.