meeg_utils.qc.Check#
- class meeg_utils.qc.Check[source]#
Base class of acquisition-quality checks.
A check answers one question about how well a recording was acquired and never modifies the data. Like a step, it takes all parameters in
__init__(thresholds included, with their source documented; thresholds without an established, dataset-independent value default toNone, i.e. the value is only reported); thencompute()measures the recording and storesmetrics_: the measurements (plain, JSON-serializable values);findings_: oneFindingper criterion evaluated, with a verdict"ok","warn"or"fail", or"info"for a measurement that has no threshold;
and
plot()draws the figures listed inplot_kinds.Subclasses set
name,modalities(and optionallysystems), implement_compute(), and may overridenot_applicable()for extra requirements (e.g. an EOG channel).- __init__()#
Methods
__init__()compute(raw)Measure the recording.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
not_applicable(raw)Return why the check cannot run on
raw, orNoneif it can.plot([kind, inst])Draw quality-control figures.
set_params(**params)Set the parameters of this estimator.
Attributes
The worst verdict of the findings (
"ok"if there are none).Data types the check needs at least one of ("meg", "eeg").
Key of the check in reports.
plot_kindskind -> whether it needs data (
inst).Acquisition systems the check applies to;
Nonemeans all.- modalities: ClassVar[frozenset[str]] = frozenset({'eeg', 'meg'})#
Data types the check needs at least one of (“meg”, “eeg”).
- systems: ClassVar[frozenset[str] | None] = None#
Acquisition systems the check applies to;
Nonemeans all.
- not_applicable(raw)[source]#
Return why the check cannot run on
raw, orNoneif it can.- Parameters:
raw (Raw) – The recording.
- Returns:
The reason, or
None.- Return type:
str | None
- compute(raw)[source]#
Measure the recording.
- Parameters:
raw (Raw) – The preloaded recording; it is not modified.
- Returns:
self – The check, with
metrics_andfindings_set.- Return type:
- Raises:
ValueError – If the check does not apply to the recording.