def get_image_id(filename):
    """ Gets id of an image. The id is constructed using the date of the
    typhoon. Note that typhoons from different sequences might have the
    same ID since they were recorded at the same time. Therefore, the final
    id is constructed using both the date and the typhoon ID together.
    To build the image id, the name of the original HDF file is used,
    which have the following structure:
    *YYYYMMDDHH-<typhoon id>-<satellite model>.h5*
    We can then parse it to the id, namely
    *<typhoon id>_YYYYMMDDHH*

    :param filename: Name of the HDF image file.
    :type filename: str
    :return: Image frame id
    :rtype: int
    """
    return filename.split('-')[1] + '_' + filename.split('-')[0]
