[Mne_analysis] [mne-python] strange behavior of raw.save()

Martin Luessi mluessi at nmr.mgh.harvard.edu
Sat Sep 8 17:39:08 EDT 2012
Search archives:

Hi Denis,

Are you by any chance saving the raw file to the same file from where 
you read it? I.e., something like

raw = Raw('test_raw.fif')
..
raw.save('test_raw.fif')

Unless you use preload=True, this won't work since raw.save() will read 
from the file and at the same time overwrite it. We should add a check 
such that it throws and exception with a explanatory error message if 
one tries to do this.

Martin

On 09/08/12 16:04, Denis-Alexander Engemann wrote:
> Hi all,
>
> on saving a raw file using the instance method save() I get the
> following error message.
>
> http://pastebin.com/g66H4svV
>
> After that the file is not readable anymore ( the same error message
> will appear as Raw.__init__() is called. )
>
> If I use an alternative file name this does not happen.
>
> a) what is the reason for that / what does it actually tell, and
>
> b) shouldn't that rather throw an exception than messing up the original file?
>
>
> Cheers,
> Denis
>
>
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
> 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
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
>
> Kennen Sie schon unsere app? http://www.fz-juelich.de/app
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>






More information about the Mne_analysis mailing list