colab Open in SageMaker Studio Lab Open in Planetary Computer

Tasseled Cap

Tutorial created by **Aaron Zuspan**: 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

Authenticate and Initialize Earth Engine and geemap.

[3]:
Map = geemap.Map()

Tasseled cap brightness, greenness, and wetness components can be calculated in eemont using the tasseledCap method extended to ee.Image and ee.ImageCollection objects. Just load imagery from a supported platform and use tasseledCap to add the component bands.

Sentinel-2

[4]:
img = ee.Image("COPERNICUS/S2/20160111T112432_20160111T113311_T28PDT").tasseledCap()

By looking at the band names, we can see that running tasseledCap returned our image with brightness (TCB), greenness (TCG), and wetness (TCW) bands added.

[5]:
img.bandNames().getInfo()
[5]:
['B1',
 'B2',
 'B3',
 'B4',
 'B5',
 'B6',
 'B7',
 'B8',
 'B8A',
 'B9',
 'B10',
 'B11',
 'B12',
 'TCB',
 'TCG',
 'TCW']

Now we can visualize the tasseled cap components. By assigning brightness, greenness, and wetness to the red, green, and blue channels, respectively, soil and developments will appear red, vegetation will appear green, and water will appear blue.

[6]:
Map.addLayer(img, {"min": [-1000, -1000, -100], "max": [9000, 2000, 800], "bands": ["TCB", "TCG", "TCW"]}, "S2 TC")
Map.centerObject(img, 10)

Map

Notice that we had to set different min and max stretch values for the different components. You may have to experiment with these values to achieve good visual results depending on the dataset and scene.

MODIS

Let’s look at another tasseled cap example with a different dataset: MODIS.

Create a fresh map.

[7]:
Map = geemap.Map()

Load an image from the MODIS NBAR collection and add tasseled cap components.

[8]:
modis = ee.Image("MODIS/006/MCD43A4/2020_05_01").tasseledCap()

And visualize the components.

[9]:
Map.addLayer(modis, {"min": [-1000, -1000, -100], "max": [9000, 2000, 800], "bands": ["TCB", "TCG", "TCW"]}, "MODIS TC")

# Zoom in on a fixed point
pt = ee.Geometry.Point((134.7, -25.1))
Map.centerObject(pt, 4)

Map