nirspipe.qc.hyper.hyper_usable#
The dyad’s shared usable time, as the numbers a cohort reads rather than as a carpet.
A cell is one channel pair in one window, and it is usable only while the pair is passing in
both members at that moment. That intersection is what
dyad_status() computes; this reduces it to what a
cohort report can carry: a handful of scalars for the record, and one row per
(pair, condition) for the panels.
Two layers on purpose. The record holds one number per dyad, the way every other quality record does, and a vector as long as the montage goes beside it in a table, the way the per-channel SCI scores already do.
Module Contents#
Functions#
The dyad-level numbers a cohort table and its outlier rule read. |
|
One row per (pair, condition): the three shares inside that block. |
|
Write the usable-time table with its sidecar. None when there is nothing to write. |
Data#
API#
- nirspipe.qc.hyper.hyper_usable.logger = 'get_logger(...)'#
- nirspipe.qc.hyper.hyper_usable.usable_scalars(grid: dict, subject_ids: list[str]) dict#
The dyad-level numbers a cohort table and its outlier rule read.
-> {"n_long_pairs": 14, "usable_pairs_mean": 11.8, "usable_window_frac": 0.82, "one_member_frac": 0.11, "neither_frac": 0.07, "usable_stretch_s": 170.0, "n_windows": 120}
The three fractions sum to 1 and are the split no subject-level record can make.
one_member_fracis an asymmetric loss, one cap or one electrode, andneither_fraca shared one, both members out at the same moment; two dyads with the same usable share and different middles are two different problems.usable_stretch_sis the median over pairs of that pair’s longest unbroken usable run, which the fractions cannot show: a coherence window needs contiguous data.
- nirspipe.qc.hyper.hyper_usable.usable_table(grid: dict, subject_ids: list[str], conditions: dict[str, tuple[float, float]] | None = None) pandas.DataFrame#
One row per (pair, condition): the three shares inside that block.
Columns:
pair,condition,usable_frac,one_member_frac,neither_frac,n_windows. A dyad with no annotated blocks gets one row per pair under the conditionwhole_run, so the table has the same shape either way and a cohort panel does not have to know which it is reading.The windows are on the dyad’s aligned clock,
passing_grid()having already put every member on it; a condition span measured on a member’s own clock would select the wrong columns here by that member’s crop offset.