Annexes
ANNEXE B : PROGRAMME DE TRAITEMENT DES IMAGES
SATELLITAIRES SUR PYTHON
Importation des librairies
import ee
import folium
import geehydro
import math
from datetime import datetime as dt
from IPython.display import Image
Connexion au serveur de Google Earth Engine
# initialize the connection to the server
ee.Authenticate()
ee.Initialize()
Définition de la fonction de masque de nuages
def getQABits(image, start, end, mascara):
# Compute the bits we need to extract.
pattern = 0
for i in range(start,end+1):
pattern += 2**i
# Return a single band image of the extracted QA bits, giving the
band a new name.
return image.select([0], [mascara]).bitwiseAnd(pattern).rightShift(sta
rt)
#A function to mask out cloudy pixels.
def maskQuality(image):
# Select the QA band.
QA = image.select('pixel_qa')
# Get the internal_cloud_algorithm_flag bit.
sombra = getQABits(QA,3,3,'cloud_shadow')
nubes = getQABits(QA,5,5,'cloud')
# var cloud_confidence = getQABits(QA,6,7, 'cloud_confidence')
cirrus_detected = getQABits(QA,9,9,'cirrus_detected')
#var cirrus_detected2 = getQABits(QA,8,8, 'cirrus_detected2')
#Return an image masking out cloudy areas.
return image.updateMask(sombra.eq(0)).updateMask(nubes.eq(0).updateMas
k(cirrus_detected.eq(0)))
Initialisation de l'interface graphique pour la
cartographie
Précédent

Identification des zones propices à héberger des filières conchylicoles par modélisation numérique et télédetection - 78/87

Suivant