# problem with reading raw data

**URL:** <https://mne.discourse.group/t/problem-with-reading-raw-data/1871>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 17, 2019, 3:14pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871 "2019-06-17T15:14:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 17, 2019, 3:14pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/1 "2019-06-17T15:14:15Z")

</div>

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](https://drive.google.com/open?id=1hwOH0Gh0KOqFpFl0-4HHlr6oZliROaL8)

Output:

Opening raw data file EmptyRoom\_raw.fif...

---------------------------------------------------------------------------ValueError  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 """  
&nbsp;&nbsp;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  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw, next\_fname, buffer\_size\_sec = \ 84  
self.\_read\_raw\_file(next\_fname, allow\_maxshield,---\> 85  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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')  
&nbsp;&nbsp;&nbsp;132 133 if tag.type != FIFF.FIFFT\_ID\_STRUCT:  
ValueError: file does not start with a file id tag

Best,  
Xiaoping

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 17, 2019, 7:28pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/2 "2019-06-17T19:28:37Z")

</div>

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](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190617/2f0e87ab/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 17, 2019, 9:48pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/3 "2019-06-17T21:48:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 17, 2019, 10:09pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/4 "2019-06-17T22:09:15Z")

</div>

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](https://drive.google.com/drive/folders/1nAXAu9fitqv2Afc8nL2qScTRNbjttsTD?usp=sharing).  
Please let me know if you cannot download them.

Are corrupted files fixable?

Thanks,  
Xiaoping

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 17, 2019, 10:25pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/5 "2019-06-17T22:25:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 18, 2019, 12:52am UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/6 "2019-06-18T00:52:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 19, 2019, 10:48pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/7 "2019-06-19T22:48:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 19, 2019, 10:57pm UTC](https://mne.discourse.group/t/problem-with-reading-raw-data/1871/8 "2019-06-19T22:57:47Z")

</div>

External Email - Use Caution

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

Denis
