def _read_comp_coeff(fid, d):
    # Read the coefficients and initialize
    d['ncomp'] = _read_int2(fid)
    d['comp'] = list()
    # Read each record
    for k in range(d['ncomp']):
        comp = dict()
        d['comp'].append(comp)
        comp['sensor_name'] = _read_string(fid, 32)
        comp['coeff_type'] = _read_int(fid)
        _read_int(fid)  # pad
        comp['ncoeff'] = _read_int2(fid)
        comp['coeffs'] = np.zeros(comp['ncoeff'])
        comp['sensors'] = [_read_string(fid, CTF.CTFV_SENSOR_LABEL)
                           for p in range(comp['ncoeff'])]
        unused = CTF.CTFV_MAX_BALANCING - comp['ncoeff']
        comp['sensors'] += [''] * unused
        fid.seek(unused * CTF.CTFV_SENSOR_LABEL, 1)
        comp['coeffs'][:comp['ncoeff']] = _read_double(fid, comp['ncoeff'])
        fid.seek(unused * 8, 1)
        comp['scanno'] = d['ch_names'].index(comp['sensor_name'])
Read compensation coefficients
dataset/ETHPy150Open mne-tools/mne-python/mne/io/ctf/res4.py/_read_comp_coeff