本文整理汇总了Python中mne.io.RawArray.save方法的典型用法代码示例。如果您正苦于以下问题:Python RawArray.save方法的具体用法?Python RawArray.save怎么用?Python RawArray.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.io.RawArray
的用法示例。
在下文中一共展示了RawArray.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_mnefiff
# 需要导入模块: from mne.io import RawArray [as 别名]
# 或者: from mne.io.RawArray import save [as 别名]
def write_mnefiff(data, filename):
"""Export data to MNE using FIFF format.
Parameters
----------
data : instance of ChanTime
data with only one trial
filename : path to file
file to export to (include '.mat')
Notes
-----
It cannot store data larger than 2 GB.
The data is assumed to have only EEG electrodes.
It overwrites a file if it exists.
"""
from mne import create_info, set_log_level
from mne.io import RawArray
set_log_level(WARNING)
TRIAL = 0
info = create_info(list(data.axis['chan'][TRIAL]), data.s_freq, ['eeg', ] *
data.number_of('chan')[TRIAL])
UNITS = 1e-6 # mne wants data in uV
fiff = RawArray(data.data[0] * UNITS, info)
if data.attr['chan']:
fiff.set_channel_positions(data.attr['chan'].return_xyz(),
data.attr['chan'].return_label())
fiff.save(filename, overwrite=True)
示例2: test_date_none
# 需要导入模块: from mne.io import RawArray [as 别名]
# 或者: from mne.io.RawArray import save [as 别名]
def test_date_none(tmpdir):
"""Test that DATE_NONE is used properly."""
# Regression test for gh-5908
n_chans = 139
n_samps = 20
data = np.random.random_sample((n_chans, n_samps))
ch_names = ['E{}'.format(x) for x in range(n_chans)]
ch_types = ['eeg'] * n_chans
info = create_info(ch_names=ch_names, ch_types=ch_types, sfreq=2048)
assert info['meas_date'] is None
raw = RawArray(data=data, info=info)
fname = op.join(str(tmpdir), 'test-raw.fif')
raw.save(fname)
raw_read = read_raw_fif(fname, preload=True)
assert raw_read.info['meas_date'] is None