class_docstr: Raw object from a NIRX fNIRS file.
  
  Parameters
  ----------
  fname : path-like
      Path to the NIRX data folder or header file.
  %(saturated)s
  %(preload)s
  %(verbose)s
  
  See Also
  --------
  mne.io.Raw : Documentation of attributes and methods.
  
  Notes
  -----
  %(nirx_notes)s
class_docstr_tok: ["Raw","object","from","a","NIRX","fNIRS","file",".","Parameters","--","--","--","--","--","fname",":","path-like","Path","to","the","NIRX","data","folder","or","header","file",".","%","(","saturated",")","s","%","(","preload",")","s","%","(","verbose",")","s","See","Also","--","--","--","--","mne.io.Raw",":","Documentation","of","attributes","and","methods",".","Notes","--","--","-","%","(","nirx_notes",")","s"]
docstr: Read a segment of data from a file.
  
  The NIRX machine records raw data as two different wavelengths.
  The returned data interleaves the wavelengths.
docstr_tok: ["Read","a","segment","of","data","from","a","file",".","The","NIRX","machine","records","raw","data","as","two","different","wavelengths",".","The","returned","data","interleaves","the","wavelengths","."]
code: def _read_segment_file(self, data, idx, fi, start, stop, cals, mult):
      """Read a segment of data from a file.
  
      The NIRX machine records raw data as two different wavelengths.
      The returned data interleaves the wavelengths.
      """
      sd_index = self._raw_extras[fi]["sd_index"]
  
      wls = list()
      for key in ("wl1", "wl2"):
          d = _read_csv_rows_cols(
              self._raw_extras[fi]["files"][key],
              start,
              stop,
              sd_index,
              self._raw_extras[fi]["bounds"][key],
          ).T
          nan_mask = self._raw_extras[fi]["nan_mask"].get(key, None)
          if nan_mask is not None:
              d[nan_mask[:, start:stop]] = np.nan
          wls.append(d)
  
      # TODO: Make this more efficient by only indexing above what we need.
      # For now let's just construct the full data matrix and index.
      # Interleave wavelength 1 and 2 to match channel names:
      this_data = np.zeros((len(wls[0]) * 2, stop - start))
      this_data[0::2, :] = wls[0]
      this_data[1::2, :] = wls[1]
      _mult_cal_one(data, this_data, idx, cals, mult)
      return data
  
imports: import datetime
  import glob
  import json
  import os.path
  import re
  from configparser import ConfigParser, RawConfigParser
  import numpy
  from scipy.io import loadmat
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _format_dig_points, create_info
  from ..._fiff.utils import _mult_cal_one
  from ..._freesurfer import get_mni_fiducials
  from ...annotations import Annotations
  from ...transforms import _get_trans, apply_trans
  from ...utils import _check_fname, _check_option, _mask_to_onsets_offsets, _validate_type, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
  from ._localized_abbr import _localized_abbr
label_desc: Use image node_id 2 for calling the RawNIRX obj's underlying member method code with example usage: obj._read_segment_file(data, idx, fi, start, stop, cals, mult) and returns: data