0
点赞
收藏
分享

微信扫一扫

Google Earth Engine (GEE) ——gee中自带的Landsat8和5数据集对于温度波段的映射出现无法运行的情况


True Color (432): Layer error: ImageCollection.mosaic: Error in map(ID=LC09_001048_20220114): Image.select: Pattern 'ST_B6' did not match any bands.

True Color (432): Layer error: ImageCollection.mosaic: Error in map(ID=LC08_001004_20210511): Image.select: Pattern 'ST_B6' did not match any bands.

Google Earth Engine (GEE) ——gee中自带的Landsat8和5数据集对于温度波段的映射出现无法运行的情况_landsat


这里是直接修改后的代码,大家可以尝试将注释代码部分去掉,结果就会出现上面的报错:

//所有参与计算的影像集合都为地标反射率SR数据集、、、、、、、、、、、、、、、、、、、
///USGS Landsat 9 Level 2, Collection 2, Tier 1

var dataset = ee.ImageCollection('LANDSAT/LC09/C02/T1_L2')
    .filterDate('2022-01-01', '2022-02-01');

// Applies scaling factors.
function applyScaleFactors(image) {
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBands, null, true);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};
Map.setCenter(-114.2579, 38.9275, 8);
Map.addLayer(dataset, visualization, 'True Color (432)');

/USGS Landsat 8 Level 2, Collection 2, Tier 1///
var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
    .filterDate('2021-05-01', '2021-06-01');

// Applies scaling factors.
function applyScaleFactors(image) {
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  //var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              //.addBands(thermalBands, null, true);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B4', 'SR_B3', 'SR_B2'],
  min: 0.0,
  max: 0.3,
};

Map.setCenter(-114.2579, 38.9275, 8);

Map.addLayer(dataset, visualization, 'True Color (432)');


///USGS Landsat 5 Level 2, Collection 2, Tier 1/

var dataset = ee.ImageCollection('LANDSAT/LT05/C02/T1_L2')
    .filterDate('2000-06-01', '2000-07-01');
print(dataset.limit(10))
// Applies scaling factors.
function applyScaleFactors(image) {
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  //var thermalBand = image.select("ST_B6").multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              //.addBands(thermalBand, null, true);
}

dataset = dataset.map(applyScaleFactors);

var visualization = {
  bands: ['SR_B3', 'SR_B2', 'SR_B1'],
  min: 0.0,
  max: 0.3,
};

Map.setCenter(-114.2579, 38.9275, 8);

Map.addLayer(dataset, visualization, 'True Color (321)');

所有目前对于所有的C02数据中,Landsat8 和5的地表反射率中,无法进行温度波段的映射和转换。只有Landsat9 是ok的。上面的代码中已经去除了温度波段的映射计算,所以结果是可以的,也可以进行正常的波段运算,这可能是GEE数据集中在归档的时候,并没有把温度波段和其它波段一起放,而是放在了Bitmask for SR_CLOUD_QA的一个子波段。这里简单举一个例子,请查看下面的Landsat5的波段。

Resolution
30 meters

Bands

Google Earth Engine (GEE) ——gee中自带的Landsat8和5数据集对于温度波段的映射出现无法运行的情况_温度_02

Google Earth Engine (GEE) ——gee中自带的Landsat8和5数据集对于温度波段的映射出现无法运行的情况_温度_03

举报

相关推荐

0 条评论