Data management

Multi-stream data aggregation: aligned to each experiment run, missing streams zero-filled on timeout, then written to HDF5.

Overview

quatm/servers/datamgr.py provides data management (DataSummary): it aggregates the data streams of several input channels and assembles them into a complete dictionary for each run. Incoming data is first accumulated in incompleteData, and once the data of all subscribed channels has arrived the whole record is moved to completeData; if some data is still missing when the run ends and times out, the missing parts are filled with zeros.

Key methods

MethodDescription
initDataq(Re)subscribe to the channels configured in the properties and to the experiment start/end events
recvData / processIncomingDataReceive data and merge it into the most recent run record
savetoFileWrite the collected run dictionary to a structured HDF5 dataset
loadFromFileRead a set of stored run dictionaries back from HDF5
clearClear all data collected so far
run_foreverBlocking loop that keeps receiving data

Usage

from quatm.servers.datamgr import DataSummary

summary = DataSummary(name="sum")
summary.initDataq()     # Subscribe to channels configured in properties
summary.run_forever()   # Keep receiving; savetoFile writes the run dictionary to .h5