MCPcopy
hub / github.com/mne-tools/mne-python / __init__

Method __init__

mne/epochs.py:440–692  ·  view source on GitHub ↗
(
        self,
        info,
        data,
        events,
        event_id=None,
        tmin=-0.2,
        tmax=0.5,
        baseline=(None, 0),
        raw=None,
        picks=None,
        reject=None,
        flat=None,
        decim=1,
        reject_tmin=None,
        reject_tmax=None,
        detrend=None,
        proj=True,
        on_missing="raise",
        preload_at_end=False,
        selection=None,
        drop_log=None,
        filename=None,
        metadata=None,
        event_repeated="error",
        *,
        raw_sfreq=None,
        annotations=None,
        verbose=None,
    )

Source from the content-addressed store, hash-verified

438
439 @verbose
440 def __init__(
441 self,
442 info,
443 data,
444 events,
445 event_id=None,
446 tmin=-0.2,
447 tmax=0.5,
448 baseline=(None, 0),
449 raw=None,
450 picks=None,
451 reject=None,
452 flat=None,
453 decim=1,
454 reject_tmin=None,
455 reject_tmax=None,
456 detrend=None,
457 proj=True,
458 on_missing="raise",
459 preload_at_end=False,
460 selection=None,
461 drop_log=None,
462 filename=None,
463 metadata=None,
464 event_repeated="error",
465 *,
466 raw_sfreq=None,
467 annotations=None,
468 verbose=None,
469 ):
470 if events is not None: # RtEpochs can have events=None
471 events = _ensure_events(events)
472 # Allow reading empty epochs (ToDo: Maybe not anymore in the future)
473 if len(events) == 0:
474 self._allow_empty = True
475 selection = None
476 else:
477 self._allow_empty = False
478 events_max = events.max()
479 if events_max > INT32_MAX:
480 raise ValueError(
481 f"events array values must not exceed {INT32_MAX}, "
482 f"got {events_max}"
483 )
484 event_id = _check_event_id(event_id, events)
485 self.event_id = event_id
486 del event_id
487
488 if events is not None: # RtEpochs can have events=None
489 for key, val in self.event_id.items():
490 if val not in events[:, 2]:
491 msg = f"No matching events found for {key} (event id {val})"
492 _on_missing(on_missing, msg)
493
494 # ensure metadata matches original events size
495 self.selection = np.arange(len(events))
496 self.events = events
497

Callers

nothing calls this directly

Calls 15

_check_consistencyMethod · 0.95
_reject_setupMethod · 0.95
load_dataMethod · 0.95
_ensure_eventsFunction · 0.85
_on_missingFunction · 0.85
_handle_event_repeatedFunction · 0.85
warnFunction · 0.85
_picks_to_idxFunction · 0.85
pick_infoFunction · 0.85
_check_baselineFunction · 0.85
_log_rescaleFunction · 0.85
setup_projFunction · 0.85

Tested by

no test coverage detected