[Mne_analysis] Saving data from mne.Epochs

Denis-Alexander Engemann d.engemann at fz-juelich.de
Mon Dec 17 19:10:35 EST 2012
Search archives:

Hi Vincent,

the code you posted constructs an epochs object from which you get the data by calling .get_data().
The returned value however is not an epochs object anymore but a regular numpy array.
For saving your epochs say:

myepochs.save('subj_rest_raw_epoch.fif')

However make sure your mne-python version already supports this quite recent method.
In IPython try myepochs. <TAB> and see whether 'save'  is being provided.
In case you don't use the current development master, there will be an official new relase before christmas.

I hope this helps.

Denis





On Tue, Dec 18, 2012 at 12:22 AM, Vincent <cloud.ctl at gmail.com<mailto:cloud.ctl at gmail.com>> wrote:
Greetings,

When running a script which contains the following line:

<<<
# Read epochs
myepochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,
        picks=picks, baseline=(None, 0), preload=True,
        reject=dict(grad=4000e-13, mag=4e-12, eog=150e-6))
outfile = myepochs.get_data()

outfile.save('subj_rest_raw_epoch.fif')
>>>

I receive this error message:

<<<
Traceback (most recent call last):
  File "resting_V3.py", line 55, in <module>
    outfile.save('subj_rest_raw_epoch.fif')
AttributeError: 'numpy.ndarray' object has no attribute 'save'
>>>

Alternatively, I could forgo running epochs.get_data and just save directly (epochs.save(...)),

but I run into the same error except it specifies "Epochs" instead of "numpy.ndarray" as the object with no 'save' attribute.

Is this error occurring because of a problem with my script, or might I have something wrong with my installation of mne-python?

Thank you in advance.

::vincent


_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto:Mne_analysis at nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.




------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20121218/a50deb01/attachment.html 


More information about the Mne_analysis mailing list