【发布时间】:2021-06-01 22:09:08
【问题描述】:
我正在尝试在 Google 地球引擎的 MODIS LST 产品中将开尔文转换为摄氏度。但是我的代码中有一个错误。 代码是:
var LST_K = ee.ImageCollection('MODIS/006/MOD11A2')
.filterBounds(AOI)
.filterDate('2021-02-20','2021-05-31')
.select("LST_Day_1km","LST_Night_1km")
.map(function(img){
return img.multiply(0.02)
.copyProperties(img,['system:time_start','system:time_end']);
});
print(LST_K);
// convert LST to celcius
var toCelsius = function(img){
var time = img.get('system:time_start')
var celsius = img.multiply(0.02) // scale factor
.subtract(273.15) // from kelvin to C
.rename('Celcius')
.set('system:time_start',time)
return celsius;
};
var LST = LST_K.map(toCelsius)
print(LST);
print(ui.Chart.image.series(LST, AOI, ee.Reducer.median(), 1000, 'system:time_start'));
链接代码如下: https://code.earthengine.google.com/61b7668525bd38cd543f72c0ad201886
在此先感谢
【问题讨论】: