• 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 * 
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
  • 相关阅读:
    数据库系统与应用复习——第四章数据库安全性与第五章数据库完整性
    梳理一下我所知的输入输出流
    [论文笔记]DouZero: Mastering DouDizhu with Self-Play Deep Reinforcement Learning
    区块链入门相关概念
    你必须要知道Mybatis中的OGNL表达式
    Rasa NLU中的组件
    如何获取JDK Proxy动态代理生成的代理类源代码
    Java线程的生命周期,终止与复位
    【C#/.NET】使用ASP.NET Core对象池
    『期末复习』16/32位微处理器(8086)基本寄存器
  • 原文地址:https://blog.csdn.net/qq_31988139/article/details/133155518