import re


def get_config(input_image, no_data_config):
    """Read config json file for valid pixel value ranges per band and image type.

    Args:
        input_image (str): Name of the image file - must contain image type e.g. sentinel2, planet_4m.
        no_data_config (dict): Config dictionary as found in json file in input dir.

    Returns:
        str, dict: Name of image file type, dictionary of valid pixel ranges for that image type.
    """
    image_type = re.findall("sentinel2|planet_4m", input_image)[0]
    return image_type, no_data_config[image_type]