def prob_mass_grey_from_ndvi(ndvi, old_min=0.1, old_max=0.7):
    """
    Calculates probability masses for grey from NDVI values
    :param ndvi:
    :param old_min:
    :param old_max:
    :return:
    """

    # Not Green belief
    if ndvi > old_max:
        return 0
    elif ndvi < old_min:
        return 1
    else:
        new_max = 1
        new_min = 0
        old_range = old_max - old_min
        new_range = new_max - new_min
        return 1 - (((ndvi - old_min) * new_range) / old_range) + new_min