GEE | 2000-2024年区域地表昼夜温差分析

职场   2025-02-01 00:03   陕西  
各位同学,二月份好!祝大家在新的一月里,学业进步,心想事成,身体健康,万事如意!今天我们分享关于地表昼夜温差的代码,需要的同学仅需要import研究区运行即可。
参考文献:干旱区典型绿洲地表温度昼夜变化特征研究——以于田绿洲为例
一、地表昼夜温差
地表昼夜温差是指地表在一天之内白天和夜晚的温度差异,这种温差的变化对农业、生态系统以及人类健康都有重要影响。本次我们利用GEE平台,基于MODIS数据集,计算了2000-2024年某区域的地表昼夜温差,并生成了相应的月度和年度平均值折线图。
二、GEE代码
var roi = table;
var modisLST = ee.ImageCollection('MODIS/061/MOD11A1') .filterBounds(roi) .filterDate('2000-01-01', '2024-12-31') .select(['LST_Day_1km', 'LST_Night_1km']);
function calculateLSTDifference(image) { var lstDay = image.select('LST_Day_1km').multiply(0.02).subtract(273.15); var lstNight = image.select('LST_Night_1km').multiply(0.02).subtract(273.15); return image.addBands(lstDay.subtract(lstNight).rename('LST_Difference'));}
var modisLSTWithDifference = modisLST.map(calculateLSTDifference);
function computeLSTDifference(startDate, endDate) { var data = modisLSTWithDifference.filterDate(startDate, endDate); return data.select('LST_Difference').mean().clip(roi).set('system:time_start', startDate.millis());}
var monthlyLSTDifference = ee.ImageCollection( ee.List.sequence(2000, 2024).map(function(year) { return ee.List.sequence(1, 12).map(function(month) { return computeLSTDifference(ee.Date.fromYMD(year, month, 1), ee.Date.fromYMD(year, month, 1).advance(1, 'month')); }); }).flatten());
var yearlyLSTDifference = ee.ImageCollection( ee.List.sequence(2000, 2024).map(function(year) { return computeLSTDifference(ee.Date.fromYMD(year, 1, 1), ee.Date.fromYMD(year, 1, 1).advance(1, 'year')); }));
function plotLSTChart(imageCollection, title, xAxisTitle) { return ui.Chart.image.series({ imageCollection: imageCollection, region: roi, reducer: ee.Reducer.mean(), scale: 1000 }).setOptions({ title: title, hAxis: {title: xAxisTitle}, vAxis: {title: 'LST Difference (°C)'}, lineWidth: 2, colors: ['black'], pointSize: 3 });}
print(plotLSTChart(monthlyLSTDifference, 'Monthly Land Surface Temperature Difference (LST Day - LST Night)', 'Month'));print(plotLSTChart(yearlyLSTDifference, 'Annual Land Surface Temperature Difference (LST Day - LST Night)''Year'));
三、成为会员


GIS遥感数据处理应用
会员:数据处理,ArcGIS/Python/MATLAB/R/GEE教学,指导作图和论文。
 最新文章