GEE错误——Image.select: Pattern ‘MDF‘ did not match any bands

问题

错误产生
ImageCollection (Error)
Collection query aborted after accumulating over 5000 elements.
ImageCollection (268 elements)
Mean DOD550: Layer error: ImageCollection.reduce: Error in map(ID=MCD19A2_A2001001_h15v17_061_2022161165308_01):
Image.select: Pattern ‘MDF’ did not match any bands.

解决方案:

这里主要的问题,就是影像集合和影像的区别,影像集合需要通过镶嵌来变成影像,可以使用中位数、最大值、最小值和mosaic以及平均值聚合进行聚合,这里就可以进行下一步进行分析。

原始代码

var geometry = 
    /* color: #98ff00 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[98.19549716245358, 47.94793998978171],
          [98.19549716245358, 46.02971408294363],
          [104.39178622495358, 46.02971408294363],
          [104.39178622495358, 47.94793998978171]]], null, false);
// Load the Area of Interest (AOI)
var AOI = ee.FeatureCollection(geometry);

// Load MODIS AOD data
var modisCollection = ee.ImageCollection('MODIS/061/MCD19A2_GRANULES')
    .filterDate('2001-01-01', '2022-12-31')
    .filterBounds(AOI)
    .select('Optical_Depth_055');

// Define the value to assign to masked pixels.
var maskedValue = -9999;

// Create a function to set masked pixels to the desired value.
var setMaskedValue = function(image) {
   
    
    
  // Use updateMask to set masked pixels to the desired value.
  var unmaskedImage = image.updateMask(image.mask().not());
  // Return the image with masked pixels set to the desired value.
  return unmaskedImage.unmask(maskedValue);
};

// Apply the setMaskedValue function to the entire collection.
var modifiedCollection = modisCollection.map(setMaskedValue);

// Print or use modifiedCollection for further analysis.
print(modifiedCollection);


// Load MERRA-2 AOD data
// Load MERRA-2 hourly data
var Collection = ee.ImageCollection('NASA/GSFC/MERRA/aer/2')
    .filterDate('2001-01-01', '2022-12-31')
    .filterBounds(AOI)
    .select('DUEXTTAU', 'TOTEXTTAU');

// Define the date range you want to aggregate over
var startDate = ee.Date('2001-01-01');
var endDate = ee.Date('2022-12-31');

// Create a sequence of dates to represent each day in the date range
var startMillis = startDate.millis();
var endMillis = endDate.millis();

//var dateSequence = ee.List.sequence(startMillis, endMillis, 24 * 60 * 60 * 1000); // 24 hours in milliseconds
var dateSequence = ee.List.sequence(startMillis, endMillis, 30 * 

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/133155518