def METHOD_NAME(fid, d):
    """Read compensation coefficients."""
    # Read the coefficients and initialize
    d["ncomp"] = _read_int2(fid)
    d["comp"] = list()
    # Read each record
    dt = np.dtype(
        [
            ("sensor_name", "S32"),
            ("coeff_type", ">i4"),
            ("d0", ">i4"),
            ("ncoeff", ">i2"),
            ("sensors", "S%s" % CTF.CTFV_SENSOR_LABEL, CTF.CTFV_MAX_BALANCING),
            ("coeffs", ">f8", CTF.CTFV_MAX_BALANCING),
        ]
    )
    comps = np.fromfile(fid, dt, d["ncomp"])
    for k in range(d["ncomp"]):
        comp = dict()
        d["comp"].append(comp)
        comp["sensor_name"] = comps["sensor_name"][k].split(b"\x00")[0].decode("utf-8")
        comp["coeff_type"] = comps["coeff_type"][k].item()
        comp["ncoeff"] = comps["ncoeff"][k].item()
        comp["sensors"] = [
            s.split(b"\x00")[0].decode("utf-8")
            for s in comps["sensors"][k][: comp["ncoeff"]]
        ]
        comp["coeffs"] = comps["coeffs"][k][: comp["ncoeff"]]
        comp["scanno"] = d["ch_names"].index(comp["sensor_name"])