'Read a chunk of raw data.
Parameters
start : int, (optional)
first sample to include (first is 0). If omitted, defaults to the
first sample in data.
stop : int, (optional)
First sample to not include.
If omitted, data is included to the end.
sel : array, optional
Indices of channels to select.
data_buffer : array or str, optional
numpy array to fill with data read, must have the correct shape.
If str, a np.memmap with the correct data type will be used
to store the data.
projector : array
SSP operator to apply to the data.
verbose : bool, str, int, or None
If not None, override default verbose level (see
:func:`mne.verbose` and :ref:`Logging documentation <tut_logging>`
for more).
Returns
data : array, [channels x samples]
the data matrix (channels x samples).'

def _read_segment(self, start=0, stop=None, sel=None, data_buffer=None, projector=None, verbose=None):

    start = int(start)
    stop = (self.n_times if (stop is None) else min([int(stop), self.n_times]))
    if (start >= stop):
        raise ValueError('No    data    in    this    range')
    n_sel_channels = (self.info['nchan'] if (sel is None) else len(sel))
    if ((sel is not None) and (len(sel) > 1) and np.all((np.diff(sel) == 1))):
        sel = slice(sel[0], (sel[(-1)] + 1))
    idx = (slice(None, None, None) if (sel is None) else sel)
    data_shape = (n_sel_channels, (stop - start))
    dtype = self._dtype
    if isinstance(data_buffer, np.ndarray):
        if (data_buffer.shape != data_shape):
            raise ValueError(('data_buffer    has    incorrect    shape:    %s    !=    %s' % (data_buffer.shape, data_shape)))
        data = data_buffer
    elif isinstance(data_buffer, string_types):
        data = np.memmap(data_buffer, mode='w+', dtype=dtype, shape=data_shape)
    else:
        data = np.zeros(data_shape, dtype=dtype)
    cumul_lens = np.concatenate(([0], np.array(self._raw_lengths, dtype='int')))
    cumul_lens = np.cumsum(cumul_lens)
    files_used = np.logical_and(np.less(start, cumul_lens[1:]), np.greater_equal((stop - 1), cumul_lens[:(-1)]))
    cals = self._cals.ravel()[np.newaxis, :]
    if (self._comp is not None):
        if (projector is not None):
            mult = (self._comp * cals)
            mult = np.dot(projector[idx], mult)
        else:
            mult = (self._comp[idx] * cals)
    elif (projector is not None):
        mult = (projector[idx] * cals)
    else:
        mult = None
    cals = cals.T[idx]
    offset = 0
    for fi in np.nonzero(files_used)[0]:
        start_file = self._first_samps[fi]
        if (offset == 0):
            start_file += (start - cumul_lens[fi])
        stop_file = np.min([((stop - cumul_lens[fi]) + self._first_samps[fi]), (self._last_samps[fi] + 1)])
        if ((start_file < self._first_samps[fi]) or (stop_file < start_file)):
            raise ValueError('Bad    array    indexing,    could    be    a    bug')
        n_read = (stop_file - start_file)
        this_sl = slice(offset, (offset + n_read))
        self._read_segment_file(data[:, this_sl], idx, fi, int(start_file), int(stop_file), cals, mult)
        offset += n_read
    return data
