本文整理汇总了Python中mne.time_frequency.tfr.AverageTFR.crop方法的典型用法代码示例。如果您正苦于以下问题:Python AverageTFR.crop方法的具体用法?Python AverageTFR.crop怎么用?Python AverageTFR.crop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.time_frequency.tfr.AverageTFR
的用法示例。
在下文中一共展示了AverageTFR.crop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_crop
# 需要导入模块: from mne.time_frequency.tfr import AverageTFR [as 别名]
# 或者: from mne.time_frequency.tfr.AverageTFR import crop [as 别名]
def test_crop():
"""Test TFR cropping"""
data = np.zeros((3, 2, 3))
times = np.array([0.1, 0.2, 0.3])
freqs = np.array([0.10, 0.20])
info = mne.create_info(["MEG 001", "MEG 002", "MEG 003"], 1000.0, ["mag", "mag", "mag"])
tfr = AverageTFR(info, data=data, times=times, freqs=freqs, nave=20, comment="test", method="crazy-tfr")
tfr.crop(0.2, 0.3)
assert_array_equal(tfr.times, [0.2, 0.3])
assert_equal(tfr.data.shape[-1], 2)
示例2: test_crop
# 需要导入模块: from mne.time_frequency.tfr import AverageTFR [as 别名]
# 或者: from mne.time_frequency.tfr.AverageTFR import crop [as 别名]
def test_crop():
"""Test TFR cropping."""
data = np.zeros((3, 2, 3))
times = np.array([.1, .2, .3])
freqs = np.array([.10, .20])
info = mne.create_info(['MEG 001', 'MEG 002', 'MEG 003'], 1000.,
['mag', 'mag', 'mag'])
tfr = AverageTFR(info, data=data, times=times, freqs=freqs,
nave=20, comment='test', method='crazy-tfr')
tfr.crop(0.2, 0.3)
assert_array_equal(tfr.times, [0.2, 0.3])
assert_equal(tfr.data.shape[-1], 2)
示例3: test_crop
# 需要导入模块: from mne.time_frequency.tfr import AverageTFR [as 别名]
# 或者: from mne.time_frequency.tfr.AverageTFR import crop [as 别名]
def test_crop():
"""Test TFR cropping."""
data = np.zeros((3, 4, 5))
times = np.array([.1, .2, .3, .4, .5])
freqs = np.array([.10, .20, .30, .40])
info = mne.create_info(['MEG 001', 'MEG 002', 'MEG 003'], 1000.,
['mag', 'mag', 'mag'])
tfr = AverageTFR(info, data=data, times=times, freqs=freqs,
nave=20, comment='test', method='crazy-tfr')
tfr.crop(tmin=0.2)
assert_array_equal(tfr.times, [0.2, 0.3, 0.4, 0.5])
assert tfr.data.ndim == 3
assert tfr.data.shape[-1] == 4
tfr.crop(fmax=0.3)
assert_array_equal(tfr.freqs, [0.1, 0.2, 0.3])
assert tfr.data.ndim == 3
assert tfr.data.shape[-2] == 3
tfr.crop(tmin=0.3, tmax=0.4, fmin=0.1, fmax=0.2)
assert_array_equal(tfr.times, [0.3, 0.4])
assert tfr.data.ndim == 3
assert tfr.data.shape[-1] == 2
assert_array_equal(tfr.freqs, [0.1, 0.2])
assert tfr.data.shape[-2] == 2