MODULE REFERENCE
daq
anomx.data.sources.daqOptional, isolated readers for scalar fields in native FLASH/XFEL DAQ files.
DaqReadError
DaqReadErrorBases: RuntimeError
The optional native reader failed, timed out or returned an unsupported record.
DaqRecord
DaqRecord(timestamp: float, event_id: int, channel: str, values: Mapping[str, float | None], invalid_fields: Mapping[str, str], field_metadata: Mapping[str, Mapping[str, Any]], source_path: str, dataset_version: str, record_index: int)One native event, without inferred time units, calibration or physical labels.
| Parameter | Type | Default |
|---|---|---|
timestamp | float | required |
event_id | int | required |
channel | str | required |
values | Mapping[str, float | None] | required |
invalid_fields | Mapping[str, str] | required |
field_metadata | Mapping[str, Mapping[str, Any]] | required |
source_path | str | required |
dataset_version | str | required |
record_index | int | required |
Members
timestampattribute
timestamp: floatevent_idattribute
event_id: intchannelattribute
channel: strvaluesattribute
values: Mapping[str, float | None]invalid_fieldsattribute
invalid_fields: Mapping[str, str]field_metadataattribute
field_metadata: Mapping[str, Mapping[str, Any]]source_pathattribute
source_path: strdataset_versionattribute
dataset_version: strrecord_indexattribute
record_index: intiter_daq_records
iter_daq_records(source: MountedSource, *, channel: str, fields: Mapping[str, int], experiment: str, linac: str, python_executable: str | None = None, environment: Mapping[str, str] | None = None, batch_size: int = 128, timeout_seconds: float = 60.0, limit: int | None = None) -> Iterator[DaqRecord]Read explicit scalar subchannels using one isolated native process per source.
fields maps output aliases to native subchannel indices. Actual native names/types are retained, never guessed. Nonfinite values become None with an explicit invalid_fields reason. Timestamps and macropulse IDs are preserved numerically; their scientific interpretation belongs to the caller. Missing requested fields or unsupported shapes fail closed.
python_executable can select a separate Python with a compatible pydaq ABI. environment extends its environment (for example library paths). No pydaq dependency is imported in the parent. Data is transferred in batches through a bounded pipe/queue, not a new process per record. timeout_seconds bounds waiting for startup, each batch or completion. Source size/time/identity are checked by MountedSource.open around the read. Close the iterator explicitly when stopping early, e.g. with contextlib.closing. No content hash is implied by metadata validation.
| Parameter | Type | Default |
|---|---|---|
source | MountedSource | required |
channelkeyword only | str | required |
fieldskeyword only | Mapping[str, int] | required |
experimentkeyword only | str | required |
linackeyword only | str | required |
python_executablekeyword only | str | None | None |
environmentkeyword only | Mapping[str, str] | None | None |
batch_sizekeyword only | int | 128 |
timeout_secondskeyword only | float | 60.0 |
limitkeyword only | int | None | None |
Returns Iterator[DaqRecord]