import re


def get_product_class(satellite_name, product_name):
    """
    Set Product Class, processing level and product type from the acquisition identifier
    Only being done for Sentinel 1A and 1B acquisitions
    For others, they are set to None

    TO DO: Currently this is done only for Sentinel acquisitions because we have domain knowledge
           on how to extract this information. But I don't know if these concepts exist for other
           satellites. Need to research. If they exist, then need to implement.
    :param satellite_name:
    :param product_name:
    :return: product_class, product_type, processing_level
    """

    product_type = None
    processing_level = None
    product_class = None

    if satellite_name == "Sentinel-1A" or satellite_name == "Sentinel-1B":
        # sample name of S1 file : S1A_IW_SLC__1SDV_20150909T163711_20150909T163746_007640_00A97E_A69D
        match = re.search(r'([\w.-]+)_([\w.-]+)_([\w.-]+)__([\d])([\w])([\w.-]+)', product_name)
        if match:
            product_type = match.group(3)
            processing_level = match.group(4)
            product_class = match.group(5)

    return product_class, product_type, processing_level