Ejemplo n.º 1
0
def vis_nbr(ee_product, image):
    nir, swir, alpha = get_bands_by_name(ee_product, image,
                                         ['NIR', 'SWIR2', 'cloud_mask'])
    level = (nir - swir) / (nir + swir + 1e-9)
    out = apply_palette(level, ['black', 'red', 'yellow'])
    out[-1] = alpha
    return out
Ejemplo n.º 2
0
    def handler(ee_product, image, comp_image=comp_image):
        B, G, R, nir, swir, swir2 = get_bands_by_name(
            ee_product, image,
            ['Blue', 'Green', 'Red', 'NIR', 'SWIR', 'SWIR2'])
        index = ind_func(ee_product, image, already_normalised=True)
        if comp_image is not None:
            comp_index = ind_func(ee_product,
                                  comp_image,
                                  already_normalised=True)
            index = index - comp_index
        some_array, lots_array = l_func(B, G, R, nir, swir2)
        no_array = get_natural_nirswirmix(B, G, R, nir, swir2)

        combined_array = np.where(index > 1.0, some_array, no_array)
        combined_array = np.where(index > 2.0, lots_array, combined_array)
        return combined_array
Ejemplo n.º 3
0
def vis_firethresh(ee_product, image):
    swir, swir2, mask = get_bands_by_name(ee_product, image,
                                          ['SWIR', 'SWIR2', 'cloud_mask'])
    out = apply_palette((swir + swir2) / 4, ['black', 'red', 'yellow'])
    out[-1] = mask
    return out
Ejemplo n.º 4
0
def get_nbr_indicator(ee_product, image, sensitivity=1.0):
    nir, swir2 = get_bands_by_name(ee_product, image, ['NIR', 'SWIR2'])
    return sensitivity * (nir - swir2) / (nir + swir2 + 1e-9)
Ejemplo n.º 5
0
def get_veg_indicator(ee_product, image):
    red, nir = get_bands_by_name(ee_product, image, ['Red', 'NIR'])
    raw = (red - nir) / (red + nir + 1e-9)
    return raw * 2 + .7  # Scale to fit 1,2 thresholds, .15-->1, .65-->2
Ejemplo n.º 6
0
def get_fire_indicator(ee_product, image, sensitivity=1.0):
    swir, swir2 = get_bands_by_name(ee_product, image, ['SWIR', 'SWIR2'])
    # Increase sensitivity for more possible fires and more wrong indications
    return (swir + swir2) * sensitivity