meeg_utils.qc.Amplitude#

class meeg_utils.qc.Amplitude(*, min_flat_duration=0.05, min_clip_duration=0.01, bad_percent=5.0)[source]#

Flat signals, clipping (amplifier saturation) and missing samples.

  • Flat: a channel repeats exactly the same value for at least min_flat_duration; channels flat for more than bad_percent of the recording are flat channels (disconnected, broken), the rest are flat segments (dropouts).

  • Clipped: the signal stays at its own maximum or minimum for at least min_clip_duration, which is what an amplifier or SQUID at the end of its range produces.

  • Missing: NaN samples (mne.preprocessing.annotate_nan()).

Exact repetition is used instead of an amplitude threshold, so no unit- or system-specific threshold is needed.

Parameters:
  • min_flat_duration (float) – Shortest run of identical samples counted as flat, in seconds. The default (50 ms) is far longer than chance repetitions of quantized noise.

  • min_clip_duration (float) – Shortest run at the extreme value counted as clipping, in seconds (and at least 4 samples). Quantized data repeat their extreme value by chance for a few samples: up to 3 samples (5 ms) in MNE’s sample recording, where a 3-sample threshold flagged a clean channel.

  • bad_percent (float) – Percentage of time above which a channel is a flat channel (the default of mne.preprocessing.annotate_amplitude(), 5 %).

metrics_#

flat_channels, clipped_channels and nan_channels; flat_segments_s (flat time in the other channels) and, per channel type, the percentage of time each affected channel is flat, clipped or NaN.

Type:

dict

Notes

Figures: "channels" (percentage of time flat / clipped / NaN for every affected channel).

__init__(*, min_flat_duration=0.05, min_clip_duration=0.01, bad_percent=5.0)[source]#

Methods

__init__(*[, min_flat_duration, ...])

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, or None if it can.

plot([kind, inst])

Draw quality-control figures.

set_params(**params)

Set the parameters of this estimator.

Attributes

level

The worst verdict of the findings ("ok" if there are none).

modalities

Data types the check needs at least one of ("meg", "eeg").

name

Key of the check in reports.

plot_kinds

kind -> whether it needs data (inst).

systems

Acquisition systems the check applies to; None means all.

name: ClassVar[str] = 'amplitude'#

Key of the check in reports.

plot_kinds: ClassVar[dict[str, bool]] = {'channels': False}#

kind -> whether it needs data (inst). Each kind is drawn by a _plot_<kind>(inst, **kwargs) method.

Type:

Figures the object can draw once fitted