赞
踩
今天来简单分享在上一篇文章的基础上计算植被状况指数(VCI)和温度条件指数(TCI)
目标:
利用MODIS为数据源,在GEE计算某一地区对月VCI和TCI,并制作统计图
以武汉市为研究区
Kogan等提出的植被状态指数(vegetation condition index,VCI)。与NDVI一样,VCI也可以通过NOAA卫星的AVHRR传感器获取,VCI对干旱敏感可以消除地理位置、生态系统对NDVI的影响,成为了大规模遥感干旱监测的理想数据,它的可靠性得到了大量数据的证明。它是在ndvi的基础上计算得出的。
同样而言,TCI也是在LST的基础上计算得出的,
具体的定义的可以查阅相关的论文
GEE实现代码:
首先确定研究区和使用的数据集
- var roi = ee.FeatureCollection("users/lilei655123/WUhan");
- Map.centerObject(roi,7)
- var styling = {color:"red",fillColor:"00000000"};
- Map.addLayer(roi.style(styling),{},"geometry")
- //添加MODIS植被指数16天全球250米
- var Coll_NDVI = ee.ImageCollection("MODIS/006/MOD13Q1")
- //MODIS/006/MOD13A1
- var Coll_LST = ee.ImageCollection("MODIS/006/MOD11A2")
- //MODIS/006/MOD11A1
确定起止时间和月份
- var startYear = 2010;
- var endYear = 2020;
- var startDate = ee.Date.fromYMD(startYear, 1, 1);
- var endDate = ee.Date.fromYMD(endYear, 12, 31);
合成NDVI和LST
- Coll_NDVI = Coll_NDVI.filterDate(startDate, endDate).select("NDVI");
- Coll_NDVI = ee.ImageCollection(ee.Algorithms.If(Coll_NDVI.size().eq(0),
- ee.ImageCollection(ee.Image(0).selfMask().rename('NDVI')),
- Coll_NDVI
- ));
- Coll_LST = Coll_LST.filterDate(startDate, endDate).select("LST_Day_1km");
- Coll_LST = ee.ImageCollection(ee.Algorithms.If(Coll_LST.size().eq(0),
- ee.ImageCollection(ee.Image(0).selfMask().rename('LST_Day_1km')),
- Coll_LST
- ));
- // MOD12Q1数据的NDVI比例为0.0001 [ 最小值=-2000,最大值=10000]
- var Coll_NDVI = Coll_NDVI.map(function(img) {
- return img
- .divide(10000).float().set("system:time_start", img.get("system:time_start")); // keep time info
- });
-
-
- var Coll_LST = Coll_LST.map(function(img) {
- return img
- .multiply(0.02).subtract(273.15).float().set("system:time_start", img.get("system:time_start")); // keep time info
- });
-
-
- print(Coll_NDVI);
- print(Coll_LST);
合成VCI和TCI
- var VCI2 = monthlyNDVI.map(function(image) {
- var img = image.select('NDVI').clip(roi);
- return image.addBands(image.expression(
- "100*(NDVI-min)/(max-min)",{
- "NDVI" : img,
- "max" : ee.Image(MonthlyMAX.filter(ee.Filter.eq('month', image.get('month'))).first()),
- "min" : ee.Image(MonthlyMIN.filter(ee.Filter.eq('month', image.get('month'))).first()),
- })
- .rename('VCI')).copyProperties(img,['system:time_start','system:time_end']);
- });
-
-
- //print(VCI2)
- Map.addLayer(VCI2)
- Map.centerObject(roi)
- var clipped_VCI = VCI2.mean().clip(roi).select('VCI');
- var VCI_Vis = {
- min: 0.0,
- max: 100.0,
- palette: [
- 'red', 'yellow', 'green'],
- };
-
-
- Map.addLayer(clipped_VCI, VCI_Vis, 'VCI');
- //计算TCI: 温度条件指数(TCI)
- // 温度条件指数(TCI)
- var TCI2 = monthlyLST.map(function(image) {
- var img = image.select('LST_Day_1km').clip(roi);
- return image.addBands(image.expression(
- "100*(LST_Day_1km-min)/(max-min)",{
- "LST_Day_1km" : img,
- "max" : ee.Image(Monthly_LST_MAX.filter(ee.Filter.eq('month', image.get('month'))).first()),
- "min" : ee.Image(Monthly_LST_MIN.filter(ee.Filter.eq('month', image.get('month'))).first()),
- })
- .rename('TCI')).copyProperties(img,['system:time_start','system:time_end']);
- });
- //print(TCI2)
- //Map.addLayer(TCI2)
- var clipped_TCI = TCI2.mean().clip(roi).select('TCI');
- var TCI_Vis = {
- min: 0,
- max: 100,
- palette: [
- 'green', 'yellow', 'red'],
- };
- Map.addLayer(clipped_TCI, TCI_Vis, 'TCI');
创建统计图
- var VCITimeSeries = ui.Chart.image.seriesByRegion(
- VCI2, roi, ee.Reducer.mean(), 'VCI', 500, 'system:time_start', 'label')
- .setChartType('ScatterChart')
- .setOptions({trendlines: {0: {color: 'red'}},lineWidth: 1,pointSize: 3,
- title: 'MODIS VCI Time Series',
- vAxis: {title: 'VCI'},
- series: {
- 0: {color: 'red'},
-
- }});
-
-
- print(VCITimeSeries);
- print(ui.Chart.image.series(VCI2 , roi , ee.Reducer.mean(), 500));
-
-
- var TCITimeSeries = ui.Chart.image.seriesByRegion(
- TCI2, roi, ee.Reducer.mean(), 'TCI', 500, 'system:time_start', 'label')
- .setChartType('ScatterChart')
- .setOptions({trendlines: {0: {color: 'red'}},lineWidth: 1,pointSize: 3,
- title: 'MODIS TCI Time Series',
- vAxis: {title: 'TCI'},
- series: {
- 0: {color: 'red'},
-
- }});
-
-
- print(TCITimeSeries);
- print(ui.Chart.image.series(TCI2 , roi , ee.Reducer.mean(), 500));
运行结果如下:
VCI
TCI
完整代码请在公众号后台回复“0804合成月VCI和TCI”
感谢关注,欢迎转发!
声明:仅供学习使用!
希望关注的朋友们转发,如果对你有帮助的话记得给小编点个赞或者在看!
## ****更多内容请关注微信公众号“生态遥感监测笔记”**
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。