[Mne_analysis] mne.write_cov error

Peng Zan zanpeng.pz at gmail.com
Thu Apr 28 17:17:16 EDT 2016
Search archives:

Dear mne expert,

I wanted to write a covariance matrix into a *-cov.fif file using python
command 'mne.write_cov' but failed. I saved the covariance matrix into a
txt file 'R2262.txt' and then read it via python to cov_matrix. The error
occurred in the step of 'write_cov'. In tutorial, only file name and the
matrix are needed. Everything should be correct but it said 'str' had no
attribute 'save'. The detail is as follows.

>>> cov =
open('/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262cov.txt');
cov_matrix = cov.read()

>>>
mne.write_cov('/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262_trf-cp-cov.fif',cov_matrix)

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File
"/Users/Peng/Library/Python/2.7/lib/python/site-packages/mne-0.12.dev0-py2.7.egg/mne/cov.py",
line 1181, in write_cov

    cov.save(fname)

AttributeError: 'str' object has no attribute 'save'


Do you have any idea how should this work?

Thank you very much!

Sincerely,

Peng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160428/cd62359f/attachment.html 


More information about the Mne_analysis mailing list