m3resp.TimeSeries#

class m3resp.TimeSeries(values, time, sample_frequency=None, unit=None, name=None, metadata=<factory>)[source]#

A value array paired with its time axis.

values’s leading axis must line up with time (one entry per timepoint), but there’s no constraint on its remaining dimensions - a 1D array (one scalar per timepoint, e.g. global impedance), a 2D array (one value per timepoint per channel/region), or higher-dimensional arrays (e.g. EIT pixel-impedance frames: time x rows x cols) are all valid.

unit is normalized via m3resp.data.units.normalize_unit() (e.g. "uV" -> "µV"), so equivalent units from different loaders end up comparable instead of drifting into incompatible spellings.

Methods

to_manifest_row

Lightweight, JSON-serializable metadata row (no raw sample arrays).

Attributes

duration

Elapsed time covered by time, in the same units as time.

n_samples

Number of samples along the time axis.

name

sample_frequency

unit

values

time

metadata

Parameters:
property duration: float#

Elapsed time covered by time, in the same units as time.

metadata: dict[str, Any]#
property n_samples: int#

Number of samples along the time axis.

name: str | None = None#
sample_frequency: float | None = None#
time: ndarray#
to_manifest_row()[source]#

Lightweight, JSON-serializable metadata row (no raw sample arrays).

Matches the data model doc’s separation of raw arrays (kept in files) from relational/manifest metadata (Sec 8): a signals_manifest.csv/.json row should describe a stream, not embed it.

Return type:

dict[str, Any]

unit: str | None = None#
values: ndarray#