Skip to content

Commit

Permalink
Updated the equations and coefficients for Tasseled Cap Transformatio…
Browse files Browse the repository at this point in the history
…n for Brightness, Greenness and Wetness indices for Landsat and Sentinel
  • Loading branch information
XavierCLL committed Oct 17, 2024
1 parent 44f048d commit 16149ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
30 changes: 20 additions & 10 deletions core/gee_data_landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,32 @@ def get_gee_data_landsat(coords, date_range, doy_range, collection):
image.expression('2.5 * ((NIR - Red) / (NIR + 2.4 * Red + 1))',
{'NIR': image.select('NIR'),
'Red': image.select('Red')}).rename('EVI2'),
image.expression('sqrt((Red - SWIR1) * (Red - SWIR1) + (NIR - SWIR2) * (NIR - SWIR2))',
{'Red': image.select('Red'),
'SWIR1': image.select('SWIR1'),
# Brightness, Greenness, Wetness based on:
# https://yceo.yale.edu/tasseled-cap-transform-landsat-8-oli
# Muhammad Hasan Ali Baig, Lifu Zhang, Tong Shuai & Qingxi Tong (2014) Derivation of a tasselled cap
# transformation based on Landsat 8 at-satellite reflectance, Remote Sensing Letters, 5:5, 423-431,
# DOI: 10.1080/2150704X.2014.915434
image.expression('0.3029 * Blue + 0.2786 * Green + 0.4733 * Red + 0.5599 * NIR + 0.508 * SWIR1 + 0.1872 * SWIR2',
{'Blue': image.select('Blue'),
'Green': image.select('Green'),
'Red': image.select('Red'),
'NIR': image.select('NIR'),
'SWIR1': image.select('SWIR1'),
'SWIR2': image.select('SWIR2')}).rename('BRIGHTNESS'),
image.expression('Red + 2.5 * NIR - 1.5 * (Blue + SWIR1) - 0.25 * SWIR2',
{'Red': image.select('Red'),
image.expression('-0.2941 * Blue - 0.243 * Green - 0.5424 * Red + 0.7276 * NIR + 0.0713 * SWIR1 - 0.1608 * SWIR2',
{'Blue': image.select('Blue'),
'Green': image.select('Green'),
'Red': image.select('Red'),
'NIR': image.select('NIR'),
'Blue': image.select('Blue'),
'SWIR1': image.select('SWIR1'),
'SWIR2': image.select('SWIR2')}).rename('GREENNESS'),
image.expression('4 * (NIR - SWIR1) - (0.25 * SWIR2 + 2.75 * Blue)',
{'NIR': image.select('NIR'),
image.expression('0.1511 * Blue + 0.1973 * Green + 0.3283 * Red + 0.3407 * NIR - 0.7117 * SWIR1 - 0.4559 * SWIR2',
{'Blue': image.select('Blue'),
'Green': image.select('Green'),
'Red': image.select('Red'),
'NIR': image.select('NIR'),
'SWIR1': image.select('SWIR1'),
'SWIR2': image.select('SWIR2'),
'Blue': image.select('Blue')}).rename('WETNESS'),
'SWIR2': image.select('SWIR2')}).rename('WETNESS')
]))


Expand Down
23 changes: 14 additions & 9 deletions core/gee_data_sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,29 @@ def addEVI2(image):
return image.addBands(evi2.rename('EVI2'))


# Brightness, Greenness, Wetness based on:
# Shi, T., & Xu, H. (2019). Derivation of tasseled cap transformation coefficients for Sentinel-2 MSI at-sensor
# reflectance data. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(10), 4038-4048.
# https://doi.org/10.1109/JSTARS.2019.2938388

def addBrightness(image):
brightness = image.expression('sqrt((Red - SWIR1) * (Red - SWIR1) + (NIR - SWIR2) * (NIR - SWIR2))',
{'Red': image.select('Red'), 'SWIR1': image.select('SWIR1'), 'NIR': image.select('NIR'),
'SWIR2': image.select('SWIR2')})
brightness = image.expression('0.3510 * Blue + 0.3813 * Green + 0.3437 * Red + 0.7196 * NIR + 0.2396 * SWIR1 + 0.1949 * SWIR2',
{'Blue': image.select('Blue'), 'Green': image.select('Green'), 'Red': image.select('Red'),
'NIR': image.select('NIR'), 'SWIR1': image.select('SWIR1'), 'SWIR2': image.select('SWIR2')})
return image.addBands(brightness.rename('BRIGHTNESS'))


def addGreeness(image):
greeness = image.expression('Red + 2.5 * NIR - 1.5 * (Blue + SWIR1) - 0.25 * SWIR2',
{'Red': image.select('Red'), 'NIR': image.select('NIR'), 'Blue': image.select('Blue'),
'SWIR1': image.select('SWIR1'), 'SWIR2': image.select('SWIR2')})
greeness = image.expression('- 0.3599 * Blue - 0.3533 * Green - 0.4734 * Red + 0.6633 * NIR + 0.0087 * SWIR1 - 0.2856 * SWIR2',
{'Blue': image.select('Blue'), 'Green': image.select('Green'), 'Red': image.select('Red'),
'NIR': image.select('NIR'), 'SWIR1': image.select('SWIR1'), 'SWIR2': image.select('SWIR2')})
return image.addBands(greeness.rename('GREENNESS'))


def addWetness(image):
wetness = image.expression('4 * (NIR - SWIR1) - (0.25 * SWIR2 + 2.75 * Blue)',
{'NIR': image.select('NIR'), 'SWIR1': image.select('SWIR1'), 'SWIR2': image.select('SWIR2'),
'Blue': image.select('Blue')})
wetness = image.expression('0.2578 * Blue + 0.2305 * Green + 0.0883 * Red + 0.1071 * NIR - 0.7611 * SWIR1 - 0.5308 * SWIR2',
{'Blue': image.select('Blue'), 'Green': image.select('Green'), 'Red': image.select('Red'),
'NIR': image.select('NIR'), 'SWIR1': image.select('SWIR1'), 'SWIR2': image.select('SWIR2')})
return image.addBands(wetness.rename('WETNESS'))


Expand Down

0 comments on commit 16149ac

Please sign in to comment.