Get epochs.
(stop=5, meg=True, eeg=False, n_chan=20)
| 376 | |
| 377 | |
| 378 | def _get_epochs(stop=5, meg=True, eeg=False, n_chan=20): |
| 379 | """Get epochs.""" |
| 380 | raw = read_raw_fif(fname_raw_io) |
| 381 | events = read_events(fname_event_io) |
| 382 | picks = pick_types( |
| 383 | raw.info, meg=meg, eeg=eeg, stim=False, ecg=False, eog=False, exclude="bads" |
| 384 | ) |
| 385 | # Use a subset of channels for plotting speed |
| 386 | picks = np.round(np.linspace(0, len(picks) + 1, n_chan)).astype(int) |
| 387 | with pytest.warns(RuntimeWarning, match="projection"): |
| 388 | epochs = Epochs( |
| 389 | raw, |
| 390 | events[:stop], |
| 391 | event_id, |
| 392 | tmin, |
| 393 | tmax, |
| 394 | picks=picks, |
| 395 | proj=False, |
| 396 | preload=False, |
| 397 | ) |
| 398 | epochs.info.normalize_proj() # avoid warnings |
| 399 | return epochs |
| 400 | |
| 401 | |
| 402 | @pytest.fixture() |
no test coverage detected