'Read a chunk of raw data.'

def _read_segment_file(self, data, idx, fi, start, stop, cals, mult):

    if (self._order == 'C'):
        _read_segments_c(self, data, idx, fi, start, stop, cals, mult)
    elif isinstance(self.orig_format, string_types):
        dtype = _fmt_dtype_dict[self.orig_format]
        n_data_ch = (len(self.ch_names) - 1)
        _read_segments_file(self, data, idx, fi, start, stop, cals, mult, dtype=dtype, n_channels=n_data_ch, trigger_ch=self._event_ch)
    else:
        offsets = self._raw_extras[fi]
        with open(self._filenames[fi], 'rb') as fid:
            fid.seek(offsets[start])
            block = np.empty((len(self.ch_names), (stop - start)))
            for ii in range((stop - start)):
                line = fid.readline().decode('ASCII')
                line = line.strip().replace(',', '.').split()
                block[:(-1), ii] = list(map(float, line))
        block[(-1)] = self._event_ch[start:stop]
        _mult_cal_one(data, block, idx, cals, mult)
