def _read_one_coil_point(fid):
    """Read coil coordinate information from the hc file"""
    # Descriptor
    one = '#'
    while len(one) > 0 and one[0] == '#':
        one = fid.readline()
    if len(one) == 0:
        return None
    one = one.strip().decode('utf-8')
    if 'Unable' in one:
        raise RuntimeError("HPI information not available")

    # Hopefully this is an unambiguous interpretation
    p = dict()
    p['valid'] = ('measured' in one)
    for key, val in _coord_dict.items():
        if key in one:
            p['coord_frame'] = val
            break
    else:
        p['coord_frame'] = -1

    for key, val in _kind_dict.items():
        if key in one:
            p['kind'] = val
            break
    else:
        p['kind'] = -1

    # Three coordinates
    p['r'] = np.empty(3)
    for ii, coord in enumerate('xyz'):
        sp = fid.readline().decode('utf-8').strip()
        if len(sp) == 0:  # blank line
            continue
        sp = sp.split(' ')
        if len(sp) != 3 or sp[0] != coord or sp[1] != '=':
            raise RuntimeError('Bad line: %s' % one)
        # We do not deal with centimeters
        p['r'][ii] = float(sp[2]) / 100.0
    return p
dataset/ETHPy150Open mne-tools/mne-python/mne/io/ctf/hc.py/_read_one_coil_point/original