我正在尝试计算 GEE 研究区域内 2012 年的 NDVI。我相信最好的可用质量是 Landsat 5,当我尝试使用此功能过滤图像集合时: “var landsatCollection = ee.ImageCollection('LANDSAT/LT05/C01/T1')”,会弹出一条通知,表明这是一个已删除的 Landsat 数据集。 这是我的全部代码:
// Filter the image collection based on region and date range
var Filtered_Region = ImageCollection.filterBounds(Region);
var startDate = '2012-04-01';
var endDate = '2012-05-15';
// Function to calculate NDVI for Landsat 5 images
function calculateNDVI(image) {
var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI'); // B4: NIR, B3: Red
return image.addBands(ndvi);
}
// Filter Landsat 5 image collection for the given date range and region
var landsatCollection = ee.ImageCollection('LANDSAT/LT05/C02/T1')
.filterBounds(Region)
.filterDate(startDate, endDate)
.map(calculateNDVI);
// Get the median NDVI image over the date range
var medianNDVI = landsatCollection.select('NDVI').median();
// Define visualization parameters
var visParams = {
min: -1,
max: 1,
palette: ['blue', 'white', 'green']
};
// Add the NDVI layer to the map with a custom name
Map.addLayer(medianNDVI, visParams, 'NDVI 2012');
// Print the NDVI image to the console for additional information
print('Median NDVI Image:', medianNDVI);
我尝试将其更改为“LANDSAT/LT05/C02/T1_L2”或“LANDSAT/LT05/C02/T1”,但这些似乎不起作用(该图层没有可可视化的波段)。
Landsat 5 图像采集将于 2012 年 5 月左右结束。对于您的日期范围,只有美国的部分地区有可用图像(美国中西部和西部)。不幸的是,我无法在此处附加屏幕截图。
因此,如果满足您的选择标准,我建议下一个最佳选择,即使用 Landsat 7 图像集。