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

Function short_raw_epochs

mne/preprocessing/tests/test_ica.py:606–643  ·  view source on GitHub ↗

Get small data.

()

Source from the content-addressed store, hash-verified

604
605@pytest.fixture
606def short_raw_epochs():
607 """Get small data."""
608 raw = read_raw_fif(raw_fname).crop(0, 5).load_data()
609 # some gymnastics here because tests fail if the channels get out of order...
610 picks = raw.ch_names[::10] + ["EOG 061", "MEG 1531", "MEG 1441", "MEG 0121"]
611 raw.pick(list(filter(lambda ch: ch in picks, raw.ch_names)))
612 assert "eog" in raw
613 raw.del_proj() # avoid warnings
614 raw.set_annotations(Annotations([0.5], [0.5], ["BAD"]))
615 raw.resample(100)
616 # XXX This breaks the tests :(
617 # raw.info['bads'] = [raw.ch_names[1]]
618 # Create epochs that have different channels from raw
619 events = make_fixed_length_events(raw)
620 picks = pick_types(raw.info, meg=True, eeg=True, eog=False)[:-1]
621 epochs = Epochs(
622 raw,
623 events,
624 None,
625 tmin,
626 tmax,
627 picks=picks,
628 baseline=(None, 0),
629 preload=True,
630 proj=False,
631 )
632 assert len(epochs) == 3
633 epochs_eog = Epochs(
634 raw,
635 epochs.events,
636 event_id,
637 tmin,
638 tmax,
639 picks=("meg", "eog"),
640 baseline=(None, 0),
641 preload=True,
642 )
643 return raw, epochs, epochs_eog
644
645
646@pytest.mark.slowtest

Callers

nothing calls this directly

Calls 11

read_raw_fifFunction · 0.90
AnnotationsClass · 0.90
make_fixed_length_eventsFunction · 0.90
pick_typesFunction · 0.90
EpochsClass · 0.90
del_projMethod · 0.80
load_dataMethod · 0.45
cropMethod · 0.45
pickMethod · 0.45
set_annotationsMethod · 0.45
resampleMethod · 0.45

Tested by

no test coverage detected