problem with reading raw data

External Email - Use Caution

Hello,

I have trouble reading some of my raw data files. They seem pretty random
-- two are empty room recordings from two different participants recorded
at the end of the session, three are task files, while the other files are
fine. The error is "file does not start with a file id tag". Below are the
details. Could you help me with this? Thank you very much!

Link to one of the data files:
https://drive.google.com/open?id=1hwOH0Gh0KOqFpFl0-4HHlr6oZliROaL8

Output:

Opening raw data file EmptyRoom_raw.fif...

---------------------------------------------------------------------------ValueError
                               Traceback (most recent call
last)<ipython-input-87-3e7740fb39a4> in <module> 6
fname_projs = "erm-proj.fif" 7 fname_erm_wproj =
"EmptyRoom_wproj_raw.fif"----> 8 raw_erm =
mne.io.read_raw_fif(fname_erm, preload=True) 9
raw_erm.add_proj([],remove_existing=True) 10
raw_erm.info['bads'] = ['MEG0432','MEG2233','MEG2543']
~/anaconda3/lib/python3.7/site-packages/mne/io/fiff/raw.py in
read_raw_fif(fname, allow_maxshield, preload, verbose) 468 """
  469 return Raw(fname=fname, allow_maxshield=allow_maxshield,-->
470 preload=preload,
verbose=verbose)</Users/xif20/anaconda3/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-160>
in __init__(self, fname, allow_maxshield, preload, verbose)
~/anaconda3/lib/python3.7/site-packages/mne/utils/_logging.py in
wrapper(*args, **kwargs) 87 with
use_log_level(verbose_level): 88 return
function(*args, **kwargs)---> 89 return function(*args,
**kwargs) 90 return FunctionMaker.create( 91
function, 'return decfunc(%(signature)s)',
~/anaconda3/lib/python3.7/site-packages/mne/io/fiff/raw.py in
__init__(self, fname, allow_maxshield, preload, verbose) 83
     raw, next_fname, buffer_size_sec = \ 84
self._read_raw_file(next_fname, allow_maxshield,---> 85
                     preload, do_check_fname) 86
do_check_fname = False 87 raws.append(raw)
</Users/xif20/anaconda3/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-161>
in _read_raw_file(self, fname, allow_maxshield, preload,
do_check_fname, verbose)
~/anaconda3/lib/python3.7/site-packages/mne/utils/_logging.py in
wrapper(*args, **kwargs) 87 with
use_log_level(verbose_level): 88 return
function(*args, **kwargs)---> 89 return function(*args,
**kwargs) 90 return FunctionMaker.create( 91
function, 'return decfunc(%(signature)s)',
~/anaconda3/lib/python3.7/site-packages/mne/io/fiff/raw.py in
_read_raw_file(self, fname, allow_maxshield, preload, do_check_fname,
verbose) 151 whole_file = True 152 fname_rep
= _get_fname_rep(fname)--> 153 ff, tree, _ = fiff_open(fname,
preload=whole_file) 154 with ff as fid: 155
# Read the measurement info
</Users/xif20/anaconda3/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-6>
in fiff_open(fname, preload, verbose)
~/anaconda3/lib/python3.7/site-packages/mne/utils/_logging.py in
wrapper(*args, **kwargs) 87 with
use_log_level(verbose_level): 88 return
function(*args, **kwargs)---> 89 return function(*args,
**kwargs) 90 return FunctionMaker.create( 91
function, 'return decfunc(%(signature)s)',
~/anaconda3/lib/python3.7/site-packages/mne/io/open.py in
fiff_open(fname, preload, verbose) 129 # Check that this
looks like a fif file 130 if tag.kind != FIFF.FIFF_FILE_ID:-->
131 raise ValueError('file does not start with a file id tag')
   132 133 if tag.type != FIFF.FIFFT_ID_STRUCT:
ValueError: file does not start with a file id tag

Best,
Xiaoping

External Email - Use Caution

hi Xiaoping

where is the data coming from? is it possible that it was corrupted
during a network transfer?

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190617/2f0e87ab/attachment.html

External Email - Use Caution

Hi Xiaoping,

I tried to read the file and reproduce your error.
In my experience this type of error might be due to corrupted files.
Can you try with another file or can you try copying over the same file once more from your server?

Best,
Denis

External Email - Use Caution

Hi Denis,

Thanks for helping! I uploaded two new files (one empty room recording and
one task) and both have the same issue. Here is the new link:
https://drive.google.com/drive/folders/1nAXAu9fitqv2Afc8nL2qScTRNbjttsTD?usp=sharing.
Please let me know if you cannot download them.

Are corrupted files fixable?

Thanks,
Xiaoping

External Email - Use Caution

Ok that is unexpected. I tried to display the fif file?s content but got the same error. Did you manage to read the file with the acquisition software or the classical MNE-C?s mne_browse_raw command ?

Denis

External Email - Use Caution

Hi Alexia and Denis,

I couldn't access my computer with MNE-C now, but I will have access to it
again tomorrow and will give it a try.

I copied the data from the fileserver where all the acquired MEG data are
stored using my hard drive and then transfer to our lab's file server. Not
sure if this answers Alex's the question about where the data is from. If
not, let me know. I don't recall anything unusual when I was collecting or
saving the data files. But I guess another thing I can try is to copy those
files from the original file server again. Let me know if there is anything
else I can try.

Thanks a lot,
Xiaoping

External Email - Use Caution

Hi Alex and Denis,

I cannot read the corrupted files using mne_browse_raw, but I am now able
to open the data files after copying them again from the original file
server. Thank you both for the idea!!

Best,
Xiaoping

External Email - Use Caution

Ok so for the records, incomplete copying led to corrupted files. Initial hypothesis confirmed :slight_smile:
Glad it worked!

Denis