Repository: mne-tools/mne-python

Issue:
BUG: Unable to read multi-file CTF recordings
I believe that mne.io.read_raw_ctf fails when reading CTF recordings when the recordings is split over several meg4 files. For example with a file that is split over 6 meg4 files I get this:

```
In [3]: raw = mne.io.read_raw_ctf(filename)
ds directory : S1-6_Attractor_20161024_01.ds
    res4 data read.
    hc data read.
    Separate EEG position data file read.
    Quaternion matching (desired vs. transformed):
      -2.60   77.58    0.00 mm <->   -2.60   77.58    0.00 mm (orig :  -58.50   46.27 -257.46 mm) diff =    0.000 mm
       2.60  -77.58    0.00 mm <->    2.60  -77.58    0.00 mm (orig :   46.85  -67.71 -260.44 mm) diff =    0.000 mm
     105.10    0.00    0.00 mm <->  105.10    0.00    0.00 mm (orig :   72.92   56.83 -242.17 mm) diff =    0.000 mm
    Coordinate transformations established.
    Polhemus data for 3 HPI coils added
    Device coordinate locations for 3 HPI coils added
    64 EEG electrode locations assigned to channel info.
    64 EEG locations added to Polhemus data.
    Measurement info composed.
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.meg4: 
    System clock channel is available, checking which samples are valid.
    1104 x 1200 = 1324800 samples from 405 chs
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.1_meg4: 
    System clock channel is available, checking which samples are valid.
    1104 x 1200 = 1324800 samples from 405 chs
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.2_meg4: 
    System clock channel is available, checking which samples are valid.
    1104 x 1200 = 1324800 samples from 405 chs
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.3_meg4: 
    System clock channel is available, checking which samples are valid.
    1104 x 1200 = 1324800 samples from 405 chs
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.4_meg4: 
    System clock channel is available, checking which samples are valid.
    1104 x 1200 = 1324800 samples from 405 chs
Finding samples for S1-6_Attractor_20161024_01.ds/S1-6_Attractor_20161024_01.5_meg4: 
    System clock channel is available, checking which samples are valid.
    75 x 1200 = 90000 samples from 405 chs
    1086 samples omitted at the end
Current compensation grade : 0

In [4]: raw
Out[4]: <RawCTF  |  S1-6_Attractor_20161024_01.meg4, n_channels x n_times : 405 x 1324800 (1104.0 sec), ~1.4 MB, data not loaded>
```
The call to read_raw_ctf clearly shows that all meg4 files are found, but the raw object itself only shows the first meg4 file (1104s in raw).

I think this can be fixed by changing the following line in ctf.py:
```
diff --git a/mne/io/ctf/ctf.py b/mne/io/ctf/ctf.py
index b93ba3d..9f9837c 100644
--- a/mne/io/ctf/ctf.py
+++ b/mne/io/ctf/ctf.py
@@ -138,7 +138,7 @@ class RawCTF(BaseRaw):
             last_samps.append(sample_info['n_samp'] - 1)
             raw_extras.append(sample_info)
         super(RawCTF, self).__init__(
-            info, preload, last_samps=last_samps, filenames=fnames,
+            info, preload, first_samps=(0,)*len(last_samps), last_samps=last_samps, filenames=fnames,
             raw_extras=raw_extras, orig_format='int', verbose=verbose)
 
     @verbose
```

With this change I get the correct number of seconds in the raw object:
```
In [5]: raw
Out[5]: <RawCTF  |  S1-6_Attractor_20161024_01.meg4, n_channels x n_times : 405 x 6714000 (5595.0 sec), ~1.4 MB, data not loaded>
```

I can provide a pull request with this fix if you want. Providing a sample file for testing will be a bit harder since it necessarily will be at least two GB. 



Discussion:
Looks good. PR welcome.

Resolving patch:
diff --git a/mne/io/ctf/ctf.py b/mne/io/ctf/ctf.py
--- a/mne/io/ctf/ctf.py
+++ b/mne/io/ctf/ctf.py
@@ -137,8 +137,10 @@ def __init__(self, directory, system_clock='truncate', preload=False,
             fnames.append(meg4_name)
             last_samps.append(sample_info['n_samp'] - 1)
             raw_extras.append(sample_info)
+            first_samps = [0] * len(last_samps)
         super(RawCTF, self).__init__(
-            info, preload, last_samps=last_samps, filenames=fnames,
+            info, preload, first_samps=first_samps,
+            last_samps=last_samps, filenames=fnames,
             raw_extras=raw_extras, orig_format='int', verbose=verbose)
 
     @verbose


Test patch: