ffrprep.group.add_qc_flags

ffrprep.group.add_qc_flags(metrics, min_usable_pct=None, min_snr=None)[source]

Flag recordings that fail quality thresholds; never drop rows.

Adds boolean qc_usable_pct_ok (usable_pct >= min_usable_pct) and/or qc_snr_ok (polarity-sum RMS SNR, else the combined-evoked rms_snr, >= min_snr) columns for each threshold given, plus qc_include (all checks pass) and qc_reason (the failed checks, n/a when none). A missing value (NaN) fails its check. The metrics table keeps every subject and the grand averages are unchanged, so downstream analyses choose whether to filter on qc_include.

Returns metrics unchanged when no threshold is given.