def get_receiver_type(rinex_fname):
    """
    Return the receiver type (header line REC # / TYPE / VERS) found
    in *rinex_fname*.
    """
    with open(rinex_fname) as fid:
        for line in fid:
            if line.rstrip().endswith('END OF HEADER'):
                break
            elif line.rstrip().endswith('REC # / TYPE / VERS'):
                return line[20:40].strip()
    raise ValueError('receiver type not found in header of RINEX file '
                     '{}'.format(rinex_fname))