<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Shutil.copytree() uses shutil.copystat() to copy metadata, it's similar to `cp -p` in bash. Here is the documentation for shutil.copystat()
<a href="https://docs.python.org/2/library/shutil.html#shutil.copystat" target="_blank">
https://docs.python.org/2/library/shutil.html#shutil.copystat</a><br>
<br>
I don't do anything else for the metadata. The line that throws the error, `raw = Raw(f,preload=False,verbose=False)`, is the first line of my script involving mne except for `from mne.io import Raw` at the beginning. It would use mne for other things if it
 opened successfully but since it crashes trying to open it I don't think those things are relevant. Possibly of importance is that this run was automatically divided into 2 FIFF files because of it's size. However, the fact that I can open the original copy
 without incident makes me skeptical of how relevant that is. It turns out that the files do differ in someway that isn't detected by bash's diff command because they have different hashes. I'm looking into exactly how they differ now but am having trouble
 finding the proper tools to do so. It could be that the different file paths cause the hashses to differ, I'm not sure, I'm not very well versed in how hashes work. I'm using the md5 hash from python's hashlib module. I'm not entirely sure what other sections
 of my code would be useful for you.<br>
<br>
Thank you,<br>
Graham<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF582223"><font face="Tahoma" color="#000000" size="2"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu [mne_analysis-bounces@nmr.mgh.harvard.edu] on behalf of Denis-Alexander Engemann [denis.engemann@gmail.com]<br>
<b>Sent:</b> Friday, November 20, 2015 4:08 PM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] ValueError: raw[1]._cals must match<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hum this sounds mysterious.<br>
<div>Could you detail what you do when you copy meta data?<br>
</div>
<div>Could you maybe share some code that demonstrates what you do?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Denis</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Nov 20, 2015 at 5:48 PM, Warner, Graham Cary <span dir="ltr">
&lt;<a href="mailto:GWARNER@mgh.harvard.edu" target="_blank">GWARNER@mgh.harvard.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi all,<br>
<br>
I'm working on a python script that makes a copy of a directory of FIFF files using python's shutil.copytree() function and then removes some metadata from each of the files in that new copy using the MNE module. It works fine on the whole but there is one
 particular file which, for some reason, causes the script to break. Here is the code I use and resulting error message:<br>
<br>
&gt;&gt;&gt; f = '/space/jazz/1/users/gwarner/temp_dirs_for_fiff_registration/temp_meg_storage/pp010/009/pp010_arc_raw.fif'<br>
&gt;&gt;&gt; raw = Raw(f,preload=False,verbose=False)<br>
Traceback (most recent call last):<br>
&nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>
&nbsp; File &quot;&lt;string&gt;&quot;, line 2, in __init__<br>
&nbsp; File &quot;/space/jazz/1/users/gwarner/anaconda/lib/python2.7/site-packages/mne/utils.py&quot;, line 538, in verbose<br>
&nbsp;&nbsp;&nbsp; return function(*args, **kwargs)<br>
&nbsp; File &quot;/space/jazz/1/users/gwarner/anaconda/lib/python2.7/site-packages/mne/io/fiff/raw.py&quot;, line 114, in __init__<br>
&nbsp;&nbsp;&nbsp; _check_raw_compatibility(raws)<br>
&nbsp; File &quot;/space/jazz/1/users/gwarner/anaconda/lib/python2.7/site-packages/mne/io/base.py&quot;, line 1995, in _check_raw_compatibility<br>
&nbsp;&nbsp;&nbsp; raise ValueError('raw[%d]._cals must match' % ri)<br>
ValueError: raw[1]._cals must match<br>
<br>
The strangest part is that I can open the original file without any problems:<br>
<br>
&gt;&gt;&gt; f = '/space/lilli/3/users/DARPA-TRANSFER/meg/pp010/009/pp010_arc_raw.fif'<br>
&gt;&gt;&gt; raw = Raw(f,preload=False,verbose=False)&gt;&gt;&gt; <br>
<br>
Stranger still is that the bash diff command tells me that both versions of the file are identical.<br>
<br>
&nbsp;[gwarner@jazz ~]$ diff /space/jazz/1/users/gwarner/temp_dirs_for_fiff_registration/temp_meg_storage/pp010/009/pp010_arc_raw.fif /space/lilli/3/users/DARPA-TRANSFER/meg/pp010/009/pp010_arc_raw.fif<br>
[gwarner@jazz ~]$ <br>
<br>
The fact that it works fine for several hundred files before breaking here tells me that it isn't a problem with my implementation of the module, the fact that I can successfully open the original copy of the file tells me that it isn't just a bad/corrupted
 file, and the result of the diff test seems to indicate that it isn't a problem with the way it was copied either. I'm using the same version of MNE each time and have all the necessary permissions. Can anyone enlighten me as to what is going on here? Please
 let me know if there is any additional information I can provide to clear this up.<br>
<br>
Thank you,<br>
Graham<br>
</div>
</div>
<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>