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.
that must be it.
I actually I was testing a new command line tool of mine for mass riff
export / augmentation / conversion
And in one of the use cases I simply wanted to change the info
structure without loading the data.
So this means I can either preload the data or work around it by e.g.
iterative renaming.
To prevent users from tnings like that one could add something like
raw.save(fname)
(...)
if fname == self.raw.info['filename'] and not self.preload:
raise ValueError("Invalid operation "
"Either load data or use alternative file name")
Wdyt?
Cheers,
Denis
2012/9/8 Martin Luessi <mluessi at nmr.mgh.harvard.edu>:
if fname == self.info['filename'] and not hasattr(self,'_data'):
raise ValueError('Invalid operation. Either read data with preload '
'option or use alternative file name')
to Raw.save
Hower, in case the data is preloaded the file still breaks...
2012/9/8 Denis-Alexander Engemann <d.engemann at fz-juelich.de>: