m3resp.Signal#
- class m3resp.Signal(values, time, sample_frequency=None, unit=None, name=None, metadata=<factory>, modality='unknown', category=None, channel=None, source=None, processing_state='raw', derived_from=None, method=None)[source]#
A
TimeSeriestagged with modality and provenance context.Provenance fields (
sourcevsmethodare distinct and often confused):modality: which device/technique produced this -"eit","emg","ventilator". Orthogonal tocategory.category: what physical quantity these numbers are - an impedance, an airway pressure, a flow. Known aliases are canonicalized viam3resp.data.categories.normalize_category(); an unrecognized value is kept as-is, since the vocabulary is open.Nonemeans unspecified.channel: which physical/logical channel this is (e.g. an EMG lead name,"global_impedance"for EIT).source: where the data came from - the upstream producer/origin, typically the loader or library that emitted it (e.g."resurfemg","eitprocessing"). Provenance of origin, not of transformation.method: what was done to it - the specific algorithm/function that produced this particular signal (e.g."resurfemg.postprocessing.moving_baseline"). This is what distinguishes two signals sharing the samechannelandprocessing_state(e.g. two differently-filtered variants).processing_state: how far along the raw -> intermediate -> processed workflow this signal is, or"derived"if computed from another signal. SeeProcessingState.derived_from: for a"derived"signal, theprocessing_stateit was computed from (e.g. a baseline derived from the"processed"envelope hasderived_from="processed").Noneotherwise.
Methods
Lightweight, JSON-serializable metadata row (no raw sample arrays).
Attributes
valuestimemetadata- Parameters:
values (ndarray)
time (ndarray)
sample_frequency (float | None)
unit (str | None)
name (str | None)
modality (Literal['eit', 'emg', 'ventilator', 'monitor', 'unknown'] | str)
category (Literal['impedance', 'electrical_potential', 'airway_pressure', 'esophageal_pressure', 'gastric_pressure', 'transpulmonary_pressure', 'airflow', 'volume', 'tidal_volume'] | str | None)
channel (str | None)
source (str | None)
processing_state (Literal['raw', 'intermediate', 'processed', 'derived'])
derived_from (Literal['raw', 'intermediate', 'processed', 'derived'] | None)
method (str | None)
- category: Literal['impedance', 'electrical_potential', 'airway_pressure', 'esophageal_pressure', 'gastric_pressure', 'transpulmonary_pressure', 'airflow', 'volume', 'tidal_volume'] | str | None = None#