def parse_primary(data):
    """
    Parse HRIT primary header
    """

    primary_header = data[:16]
    header_len = int.from_bytes(primary_header[4:8], 'big')
    data_len = int.from_bytes(primary_header[8:16], 'big')

    return header_len, data_len