nirspipe.qc.subject.record_io#

A quality record on disk: the JSON keeps its scalars, its arrays sit in TSV tables beside it.

Module Contents#

Functions#

channel_frame

A record’s per_channel maps as one long table, one row per channel and metric.

channel_columns

Sidecar entries for a channel table, levels limited to those it holds.

write_record

Write the record’s scalars to path and its arrays to the tables beside it.

read_record

The record with its tables folded back in, in the shape the writer was handed.

Data#

API#

nirspipe.qc.subject.record_io.MATRIX_STATS = ('sci', 'psp', 'cv')#
nirspipe.qc.subject.record_io.SUMMARY_STAT = 'summary'#
nirspipe.qc.subject.record_io.CHANNEL_COLUMNS = ('name', 'section', 'metric', 'value')#
nirspipe.qc.subject.record_io.GVTD_CHANNELS = 'kept'#
nirspipe.qc.subject.record_io.channel_frame(per_channel: dict) → pandas.DataFrame#

A record’s per_channel maps as one long table, one row per channel and metric.

nirspipe.qc.subject.record_io.channel_columns(frame: pandas.DataFrame) → dict#

Sidecar entries for a channel table, levels limited to those it holds.

nirspipe.qc.subject.record_io.write_record(path: pathlib.Path, record: dict[str, Any]) → pathlib.Path#

Write the record’s scalars to path and its arrays to the tables beside it.

nirspipe.qc.subject.record_io.read_record(path: pathlib.Path) → dict[str, Any]#

The record with its tables folded back in, in the shape the writer was handed.