本文整理汇总了Python中mne.Epochs.load_data方法的典型用法代码示例。如果您正苦于以下问题:Python Epochs.load_data方法的具体用法?Python Epochs.load_data怎么用?Python Epochs.load_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.Epochs
的用法示例。
在下文中一共展示了Epochs.load_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hilbert
# 需要导入模块: from mne import Epochs [as 别名]
# 或者: from mne.Epochs import load_data [as 别名]
def test_hilbert():
"""Test hilbert on raw, epochs, and evoked."""
raw = read_raw_fif(raw_fname).load_data()
raw.del_proj()
raw.pick_channels(raw.ch_names[:2])
events = read_events(event_name)
epochs = Epochs(raw, events)
with pytest.raises(RuntimeError, match='requires epochs data to be load'):
epochs.apply_hilbert()
epochs.load_data()
evoked = epochs.average()
raw_hilb = raw.apply_hilbert()
epochs_hilb = epochs.apply_hilbert()
evoked_hilb = evoked.copy().apply_hilbert()
evoked_hilb_2_data = epochs_hilb.get_data().mean(0)
assert_allclose(evoked_hilb.data, evoked_hilb_2_data)
# This one is only approximate because of edge artifacts
evoked_hilb_3 = Epochs(raw_hilb, events).average()
corr = np.corrcoef(np.abs(evoked_hilb_3.data.ravel()),
np.abs(evoked_hilb.data.ravel()))[0, 1]
assert 0.96 < corr < 0.98
# envelope=True mode
evoked_hilb_env = evoked.apply_hilbert(envelope=True)
assert_allclose(evoked_hilb_env.data, np.abs(evoked_hilb.data))