今天来简单分享下如何在GEE合成长时序的月NDVI与LST,并进行分析

目标:

利用MODIS为数据源,在GEE计算某一地区对月NDVI与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);

合成月NDVI

var monthlyNDVI =  ee.ImageCollection.fromImages(years.map(function (y) { return months.map(function(m) {var monthly = Coll_NDVI.filter(ee.Filter.calendarRange(y, y, "year")).filter(ee.Filter.calendarRange(m, m, "month")).mean(); return monthly.set("year", y) .set("month", m).set('date', ee.Date.fromYMD(y,m,1)).set("system:time_start", ee.Date.fromYMD(y, m, 1));}); }).flatten());
print('monthlyNDVI',monthlyNDVI)
//最大合成NDVI
var MonthlyMAX =  ee.ImageCollection.fromImages(months.map(function (m) {var maxNDVI = monthlyNDVI.filter(ee.Filter.eq("month", m)).reduce(ee.Reducer.percentile({percentiles: [90]}));return maxNDVI.set("month", m);}).flatten());
//print (MonthlyMAX, 'MonthlyMAX');
Map.addLayer (MonthlyMAX.first().clip(roi),  {min:0, max:1,  'palette': ['red','yellow', 'green']}, 'MonthlyMAX');var MonthlyMIN =  ee.ImageCollection.fromImages(months.map(function (m) {var minNDVI = monthlyNDVI.filter(ee.Filter.eq("month", m)).reduce(ee.Reducer.percentile({percentiles: [10]}));return minNDVI.set("month", m);}).flatten());
//print (MonthlyMIN, 'MonthlyMIN');
Map.addLayer (MonthlyMIN.first().clip(roi),  {min:0, max:1,  'palette': ['red','yellow', 'green']}, 'MonthlyMIN');

同样的方法合成月LST

var monthlyLST =  ee.ImageCollection.fromImages(years.map(function (y) { return months.map(function(m) {var monthly = Coll_LST.filter(ee.Filter.calendarRange(y, y, "year")).filter(ee.Filter.calendarRange(m, m, "month")).mean(); return monthly.set("year", y) .set("month", m).set('date', ee.Date.fromYMD(y,m,1)).set("system:time_start", ee.Date.fromYMD(y, m, 1));}); }).flatten());
print('monthlyLST',monthlyLST)//最大合成LST
var Monthly_LST_MAX =  ee.ImageCollection.fromImages(months.map(function (m) {var maxNDVI = monthlyLST.filter(ee.Filter.eq("month", m)).reduce(ee.Reducer.percentile({percentiles: [90]}));return maxNDVI.set("month", m);}).flatten());//print (Monthly_LST_MAX, 'Monthly_LST_MAX');
Map.addLayer (Monthly_LST_MAX.first().clip(roi),  {min:15, max:35,  'palette': ['red','yellow', 'green']}, 'Monthly_LST_MAX');var Monthly_LST_MIN =  ee.ImageCollection.fromImages(months.map(function (m) {var minNDVI = monthlyNDVI.filter(ee.Filter.eq("month", m)).reduce(ee.Reducer.percentile({percentiles: [10]}));return minNDVI.set("month", m);}).flatten());//print (Monthly_LST_MIN, 'Monthly_LST_MIN');
Map.addLayer (Monthly_LST_MIN.first().clip(roi),  {min:0, max:1,  'palette': ['red','yellow', 'green']}, 'Monthly_LST_MIN');

创建统计图

var ndviTimeSeries = ui.Chart.image.seriesByRegion(monthlyNDVI, roi, ee.Reducer.mean(), 'NDVI', 500, 'system:time_start', 'label').setChartType('ScatterChart').setOptions({trendlines: {0: {color: 'green'}},lineWidth: 1,pointSize: 3,title: 'MODIS NDVI Time Series',vAxis: {title: 'NDVI'},series: {0: {color: 'green'}, }});
print(ndviTimeSeries);
print(ui.Chart.image.series(monthlyNDVI , roi , ee.Reducer.mean(), 500));

运行结果如下:

LST

NDVI的带状平均值

LST的带状平均值

完整代码请在公众号后台回复“0803合成月NDVI和LST”

感谢关注,欢迎转发!

声明:仅供学习使用!

希望关注的朋友们转发,如果对你有帮助的话记得给小编点个赞或者在看

## ****更多内容请关注微信公众号“生态遥感监测笔记”**

Google Earth Engine(GEE)合成长时序的月NDVI与LST相关推荐

  1. Google Earth Engine(GEE)批量下载代码(以 NDVI数据为例)

    下载数据先准备工作(具体细节都能查到):科学上网 谷歌邮箱,谷歌邮箱注册GEE账号. 一:导入需要下载边界shp文件. 标题 找到自己的shp文件,导入除了sbx文件的所有文件. 导入成功 命名ass ...

  2. Google Earth Engine(GEE)——User memory limit exceeded(2)

    上一次我们已经知道如何去进行避免这种错误的发生,有关详细内容,如果单单只是解决这个问题我们用到的是limit 和 first,上一次的博客在这里: (207条消息) Google Earth Engi ...

  3. Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题

    Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题 GEE中 Ctrl+space组合键用于代码输入快捷提示,能够提高编码的准确度和速度,但是, ...

  4. 使用Google Earth Engine (GEE)实现MODIS数据批量下载

    使用Google Earth Engine GEE实现MODIS数据批量下载 前言 下载数据代码 批量执行run任务 关注公众号,分享GIS知识.ArcGIS教程.SCI论文与科研日常等 前言 上图是 ...

  5. 基于google earth engine(GEE)下载研究区域影像

    基于google earth engine(GEE)下载研究区域影像 当研究需要Landsat数据时,我们可以通过USGS官网或者地理空间数据云平台下载.由于地理空间数据云目前无法下载到较新的数据,可 ...

  6. 基于Google Earth Engine的Landsat单窗算法地表温度(LST)反演

    基于Google Earth Engine的Landsat单窗算法地表温度(LST)反演 1 背景知识 2 算法介绍 3 代码 4 效果 1 背景知识   基于遥感数据的地表温度(LST)反演目前得到 ...

  7. Google Earth Engine(GEE)——可视化动态图

    代码: var geometry = /* color: #d63000 *//* shown: false *//* displayProperties: [{"type": & ...

  8. Google Earth Engine (GEE) ——卫星影像的监督分类(svm)

    问题 GEE 提供哪些机器学习技术? 如何对卫星图像进行监督分类? 如何评估分类器的准确性? 如何手动创建自己的几何图形? 目标 练习查找无云图像和使用手绘几何导入 学习训练和应用分类算法所需的基本功 ...

  9. 关于google earth engine(GEE)的一些想法与大胆预测

    我接触GEE有两年了,GEE留给我的印象是:无所不能. 不管是从庞大的数据量,还是包含遥感的各类算法:随机森林.SVM.CNN,都让人惊讶. 从GEE的云端操作来看,传统遥感需要几个月做出来的全国ND ...

最新文章

  1. Resource punkt not found.nltk.download()下载失败
  2. wordpress中文乱码处理方法
  3. 踩坑子Module引用aar
  4. centos安装android应用程序,centos7软件安装系列【二十一】安装android打包环境
  5. EventBus in SAP UI5 and Kyma
  6. Delphi 精选文章地址
  7. Spring Boot的优点入门
  8. hadoop系列一:hadoop集群安装
  9. KMP模式匹配的next数组
  10. Atitit.提升软件稳定性---基于数据库实现的持久化 循环队列 环形队列
  11. (java+selenium)Web自动化12306模拟人工滑块验证
  12. 单片机开发板抗干扰(转载于51hei单片机)
  13. Linux编译websocketpp解决方案
  14. windos读写ext3工具_Win7下读写Ext2/Ext3/Ext4文件系统
  15. Rufus v3.6 最好用的创建USB启动盘,速度嗖嗖的
  16. 电磁阀原理及控制方式
  17. 用pandas新建excel并设置表头
  18. C语言pow函数的调用
  19. python语法错误检查_Python之静态语法检查
  20. MySQL数据备份与还原(mysqldump)

热门文章

  1. 怎么压缩gif图大小?试试这个图片压缩攻略
  2. python独立样本t检验 图_Graphpad 分析教程 | 手把手教你玩转独立样本 t 检验
  3. 程序员,被代码耽误的段子手!
  4. [小技巧] git: Your branch and 'origin/master' have diverged
  5. SDHC ADMA和SDMA区别
  6. Golang之Shadowed Variables(幽灵变量)
  7. PHP全栈学习笔记7
  8. 解决win7和win8的64位系统安装NetAdvantage时总是提示%SystemDriver%inetpub\wwwroot错误的方法...
  9. 13_ue4进阶_蒙太奇动画实现一边走一边攻击
  10. 华为手机上html怎么打开,华为手机root权限怎么开启?详细的步骤以及图文教程...