没有合适的资源?快使用搜索试试~ 我知道了~
Chapter 22_ Arrays and Tasseled Cap Google Earth Engine.pdf
0 下载量 62 浏览量
2024-11-04
10:22:16
上传
评论
收藏 333KB PDF 举报
温馨提示
Google Earth Engine训练教程
资源推荐
资源详情
资源评论
Chapter 22: Arrays and Tasseled Cap
This chapter provides a workow to explore arrays and the Tasseled Cap transformation for an area near Lake Champlain, Vermont, United States.
The full GEE code can be found here.
Functions
Data Acquisition & Preprocessing
/**
* Creates a Tasseled Cap image for Landsat 5
* @param {ee.Image} image Landsat 5 image
* @return {ee.Image} Tasseled Cap image with 6 bands:
* 'brightness', 'greenness', 'wetness',
* 'fourth', 'fifth', sixth'
*/
function tasseled_cap_l5(image) {
// Define array of Tasseled Cap coefficients
var coefficients = ee.Array([
[ 0.3037, 0.2793, 0.4743, 0.5585, 0.5082, 0.1863 ],
[ -0.2848, -0.2435, -0.5436, 0.7243, 0.0840, -0.1800 ],
[ 0.1509, 0.1973, 0.3279, 0.3406, -0.7112, -0.4572 ],
[ -0.8242, 0.0849, 0.4392, -0.0580, 0.2012, -0.2768 ],
[ -0.3280, 0.0549, 0.1075, 0.1855, -0.4357, 0.8085 ],
[ 0.1084, -0.9022, 0.4120, 0.0573, -0.0251, 0.0238 ]
]);
// Select bands for use in Tasseled Cap
var image_bands_tc = image.select(['B1', 'B2', 'B3', 'B4', 'B5', 'B7']);
// Create 1-D array image (vector of length 6 for all bands per pixel)
var array_image_1d = image_bands_tc.toArray();
// Create 2-D array image (6x1 matrix for all bands per pixel) from 1-D array
var array_image_2d = array_image_1d.toArray(1);
// Get a multi-band image with TC-named bands
// Matrix multiplication: 6x6 times 6x1
var components_image = ee.Image(coefficients)
.matrixMultiply(array_image_2d)
// Remove extra dimensions
.arrayProject([0])
// Convert to regular image
.arrayFlatten([['brightness', 'greenness', 'wetness', 'fourth', 'fifth', 'sixth']]);
return components_image;
}
// Set geometries
var lake_champlain =
/* color: #d63000 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Feature(
ee.Geometry.Polygon(
[[[-74.72224061263952, 45.50738144646654],
[-74.72224061263952, 43.32625155252435],
[-71.89875428451452, 43.32625155252435],
[-71.89875428451452, 45.50738144646654]]], null, false),
{
"system:index": "0"
});
// Get Landsat 5 T1 TOA
var landsat5_t1_toa = ee.ImageCollection("LANDSAT/LT05/C01/T1_TOA");
// Get median image for Lake Champlain, VT area
var lake_champlain_august = landsat5_t1_toa
.filterBounds(lake_champlain.geometry())
.filter(ee.Filter.calendarRange(1984, 2012, 'year'))
.filter(ee.Filter.calendarRange(8, 8, 'month'))
.filterMetadata('CLOUD_COVER', 'less_than', 0.25)
.mean()
.clip(lake_champlain);
var lake_champlain_october = landsat5_t1_toa
.filterBounds(lake_champlain.geometry())
.filter(ee.Filter.calendarRange(1984, 2012, 'year'))
.filter(ee.Filter.calendarRange(10, 10, 'month'))
.filterMetadata('CLOUD_COVER', 'less_than', 0.25)
.median()
.clip(lake_champlain);
print('Lake Champlain August Mean:', lake_champlain_august);
print('Lake Champlain October Mean:', lake_champlain_october);
2024/11/4 10:19
Chapter 22: Arrays and Tasseled Cap — Remote Sensing with Google Earth Engine
https://calekochenour.github.io/remote-sensing-textbook/04-intermediate/chapter22-arrays-tasseled-cap.html
1/3
资源评论
此星光明
- 粉丝: 7w+
- 资源: 1198
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功