今天来分享一下如何在GEE中计算热度,用地表温度来反演LST,选择影像的时间为6到9月,还是以山西省为研究区
实现代码如下:
//导入自己的研究区,将其定义为roi
var roi = ee.FeatureCollection("users/lilei655123/shanxi");
var star_date = '2020-06-01'//定义起始时间
var end_date = '2020-09-30'//定义终止时间
function rmL8Cloud(image) {
var cloudShadowBitMask = (1 << 3);
var cloudsBitMask = (1 << 5);
var qa = image.select('pixel_qa');
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
return image.updateMask(mask)
.copyProperties(image)
.copyProperties(image, ["system:time_start",'system:time_end']);
}
var L8_ = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR").filterBounds(roi)
.filterDate(star_date, end_date)
//按云量排序//云量过滤
.map(rmL8Cloud)
.mean()
.clip(roi)
print(L8_)
var img = L8_.clip(roi)
//ndvi
var NDVI = img.expression('(NIR-R)/(NIR+R)',{
'R': img.select(['B4']).multiply(0.0001),
'NIR': img.select(['B5']).multiply(0.0001),
})
// 选择第Band10辐射亮度波段LST
var L8_B10 = img.select('B10').multiply(0.1)
// 计算植被覆盖度pv,假设最低值为0.05,最大值为0.95
var imgFVC = ((NDVI.subtract(ee.Image(0.05))).divide((ee.Image(0.95)).subtract(ee.Image(0.05)))).float();
var FVC=((imgFVC.lt(0)).multiply(0))
.add(((imgFVC.gt(0)).and(imgFVC.lte(1))).multiply(imgFVC))
.add((imgFVC.gt(1)).multiply(1))
//Map.addLayer(pv, {'min':0,'max':1,'palette':['#A9A9A9','00FF00']}, 'ImgFVC')
// 计算比辐射率c
var c = FVC.expression("0.004*FVC+0.986", {FVC: FVC})
// // 计算黑体辐射亮度
var LST = L8_B10.expression(
'(L8_B10/(1 + (0.00109* (L8_B10 / 1.438))*log(c)))-273.15', {
L8_B10: L8_B10,
c: c,
})
var mean = LST.reduceRegion({
reducer: ee.Reducer.mean(),
geometry:roi,
scale: 30,
maxPixels: 1e13
});
print(mean,'平均值')
var rsei_std = LST.reduceRegion({
reducer: ee.Reducer.stdDev(),
geometry:roi,
scale: 30,
maxPixels: 10e13
});
print(rsei_std,'标准差')//
var max = LST.reduceRegion({
reducer: ee.Reducer.max(),//
geometry:roi,//
scale: 30,//
maxPixels: 10e13//
});
print(max,'max')
var min = LST.reduceRegion({
reducer: ee.Reducer.min(),
geometry:roi,
scale: 30,
maxPixels: 10e13
});
print(min,'min')
Map.centerObject(roi,7)
var styling = {color:"red",fillColor:"00000000"};
Map.addLayer(roi.style(styling),{},"geometry")
Map.addLayer(LST, {'min':2,'max':49,'palette':["eff3ff","c6dbef","9ecae1","6baed6","4292c6","2171b5","084594",
"fff5f0","fee0d2","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","99000d"]}, 'LST')
计算结果显示:
其中红色代表地表温度高,蓝色代表地表温度低
统计结果:
感谢关注,欢迎转发!文章来源:https://www.toymoban.com/news/detail-544466.html
声明:仅供学习使用!文章来源地址https://www.toymoban.com/news/detail-544466.html
**更多内容请关注微信公众号“生态遥感监测笔记”
到了这里,关于Google Earth Engine(GEE)计算热度(LST)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!