class_docstr: Raw object from NeuroElectrics nedf file.
class_docstr_tok: ["Raw","object","from","NeuroElectrics","nedf","file","."]
code: def _read_segment_file(self, data, idx, fi, start, stop, cals, mult):
      dt = self._raw_extras[fi]["dt"]
      dt_last = self._raw_extras[fi]["dt_last"]
      n_full = self._raw_extras[fi]["n_full"]
      n_eeg = dt[1].subdtype[0][0].shape[0]
      # data is stored in 5-sample chunks (except maybe the last one!)
      # so we have to do some gymnastics to pick the correct parts to
      # read
      offset = start // 5 * dt.itemsize + _HDRLEN
      start_sl = start % 5
      n_samples = stop - start
      n_samples_full = min(stop, n_full * 5) - start
      last = None
      n_chunks = (n_samples_full - 1) // 5 + 1
      n_tot = n_chunks * 5
      with open(self._filenames[fi], "rb") as fid:
          fid.seek(offset, 0)
          chunks = np.fromfile(fid, dtype=dt, count=n_chunks)
          assert len(chunks) == n_chunks
          if n_samples != n_samples_full:
              last = np.fromfile(fid, dtype=dt_last, count=1)
      eeg = _convert_eeg(chunks, n_eeg, n_tot)
      trig = chunks["data"]["trig"].reshape(1, n_tot)
      if last is not None:
          n_last = dt_last["data"].shape[0]
          eeg = np.concatenate(
              (eeg, _convert_eeg(last, n_eeg, n_last)), axis=-1
          )
          trig = np.concatenate(
              (trig, last["data"]["trig"].reshape(1, n_last)), axis=-1
          )
      one_ = np.concatenate((eeg, trig))
      one = one_[:, start_sl : n_samples + start_sl]
      _mult_cal_one(data, one, idx, cals, mult)
  
file_path: mne-python/mne/io/nedf/nedf.py
imports: from copy import deepcopy
  from datetime import datetime, timezone
  import numpy
  from ..._fiff.meas_info import create_info
  from ..._fiff.utils import _mult_cal_one
  from ...utils import _check_fname, _soft_import, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 2 for calling the RawNedf obj's underlying member method code with example usage: obj._read_segment_file(data, idx, fi, start, stop, cals, mult) without return types