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
| Method | Description |
|---|---|
initDataq | (Re)subscribe to the channels configured in the properties and to the experiment start/end events |
recvData / processIncomingData | Receive data and merge it into the most recent run record |
savetoFile | Write the collected run dictionary to a structured HDF5 dataset |
loadFromFile | Read a set of stored run dictionaries back from HDF5 |
clear | Clear all data collected so far |
run_forever | Blocking 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