meeg_utils.qc.SquidJumps#

class meeg_utils.qc.SquidJumps(*, cutoff=20.0, min_shift=0.5)[source]#

Flux jumps of SQUID sensors: sudden, lasting steps in an MEG channel.

Follows FieldTrip’s jump detection (ft_artifact_zvalue as configured in its artifact-rejection tutorial): each channel is median filtered (order 9), differentiated, and the absolute derivative z-scored over time; values above cutoff (20) are candidates. A jump must also shift the signal’s level for good, which tells it from a spike, a burst of noise or a brief glitch: the median of the 200 ms after it must differ from that of the 200 ms before it (leaving 10 ms on either side), by at least min_shift of the step and by more than three times the robust spread (1.4826 MAD) of the signal in those windows.

Parameters:
  • cutoff (float) – z-score threshold of the derivative (FieldTrip tutorial: 20).

  • min_shift (float) – A jump must change the median level of the 200 ms after it, compared with the 200 ms before, by at least this fraction of its size. (With 50 ms windows, transients and noise bursts lasting about 100 ms in MNE’s sample recording passed as jumps.)

metrics_#

n_jumps, channels (channel -> number of jumps) and times (s, first 50).

Type:

dict

Notes

Figures: "jumps", the affected channels around their first jump.

__init__(*, cutoff=20.0, min_shift=0.5)[source]#

Methods

__init__(*[, cutoff, min_shift])

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] = 'squid_jumps'#

Key of the check in reports.

modalities: ClassVar[frozenset[str]] = frozenset({'meg'})#

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

systems: ClassVar[frozenset[str] | None] = frozenset({'artemis123', 'bti', 'ctf', 'kit', 'meg-other', 'neuromag'})#

Acquisition systems the check applies to; None means all.

plot_kinds: ClassVar[dict[str, bool]] = {'jumps': 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