colab Open in SageMaker Studio Lab Open in Planetary Computer

Masking Clouds and Shadows in VIIRS Products

Tutorial created by **David Montero Loaiza**: GitHub | Twitter

Let’s start!

If required, please uncomment:

[1]:
#!pip install eemont
#!pip install geemap

Import the required packages.

[2]:
import ee, eemont, geemap
import geemap.colormaps as cm

Authenticate and Initialize Earth Engine and geemap.

[3]:
Map = geemap.Map()

Let’s define a point of interest:

[4]:
poi = ee.Geometry.PointFromQuery("Belice",user_agent = "eemont-tutorial-017")

Now, the VNP09GA and the VNP13A1 VIIRS products are supported for clouds and shadows masking.

Let’s take the VNP09GA product first:

[5]:
VNP09GA = (ee.ImageCollection("NOAA/VIIRS/001/VNP09GA")
          .filterDate("2020-01-01","2021-01-01")
          .maskClouds()
          .scaleAndOffset()
          .median())

And then the VNP13A1 product:

[6]:
VNP13A1 = (ee.ImageCollection("NOAA/VIIRS/001/VNP13A1")
          .filterDate("2020-01-01","2021-01-01")
          .maskClouds()
          .scaleAndOffset()
          .median())

Visualization parameters:

[7]:
RGB = {
    "min": 0,
    "max": 1,
    "bands": ['M5', 'M4', 'M3']
}

NDVI = {
    "min": 0,
    "max": 1,
    "bands": "NDVI",
    "palette": cm.palettes.ndvi
}

Visualize everything with geemap:

[8]:
Map.addLayer(VNP09GA,RGB,"VNP09GA")
Map.addLayer(VNP13A1,NDVI,"VNP13A1")
Map.centerObject(poi,7)
Map