meeg_utils.qc.Photodiode#

class meeg_utils.qc.Photodiode(channel, *, events='auto', event_id=None, threshold=None, max_delay=0.1, max_jitter_ms=None)[source]#

Delay and jitter between the triggers and what the screen showed.

The photodiode channel is thresholded half-way between its low and high levels (or at threshold); each trigger is matched with the first photodiode onset within max_delay after it. A constant delay can be corrected by shifting the events; jitter cannot, and smears evoked responses.

Parameters:
  • channel (str) – The photodiode channel.

  • events ({"auto", "annotations", "stim"}) – Where the triggers are (as Epoch).

  • event_id (list of str | None) – Trigger names to use (None: all).

  • threshold (float | None) – Onset threshold in the channel’s units; None uses the midpoint of its 5th and 95th percentiles.

  • max_delay (float) – Longest accepted delay (s).

  • max_jitter_ms (float | None) – Standard deviation of the delay above which a warning is raised; None (default) only reports it, as the acceptable jitter depends on the analysis (no published limit).

metrics_#

n_triggers, n_matched, delay_ms (median), jitter_ms (standard deviation), delay_range_ms.

Type:

dict

Notes

Figures: "delays" (delay of each trigger over time, and their distribution).

__init__(channel, *, events='auto', event_id=None, threshold=None, max_delay=0.1, max_jitter_ms=None)[source]#

Methods

__init__(channel, *[, events, event_id, ...])

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

Key of the check in reports.

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

not_applicable(raw)[source]#

Return why the check cannot run on raw, or None if it can.

Parameters:

raw (Raw) – The recording.

Returns:

The reason, or None.

Return type:

str | None