LANDSAT 8 表面反射率有四个图块(路径:41,行:35/路径:41,行:36/路径:42,行:35/路径:42,行:36)覆盖我的研究区域。我只想从此集合中删除路径为 42 和第 36 行的图像(平铺)。我怎样才能做到这一点?这是我的代码:
Map.centerObject(table);
Map.addLayer(table);
var sd = '2015-01-01';//Start Date
var ed = '2016-01-01';//End Date
var suro = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(table)
.filterDate(sd,ed)
//.filter(ee.Filter.and(ee.Filter.notEquals('WRS_PATH',42),ee.Filter.notEquals('WRS_ROW',36)))
.filter(ee.Filter.lt('CLOUD_COVER', 45));
var sur = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(table)
.filterDate(sd,ed)
//.filter(ee.Filter.and(ee.Filter.notEquals('WRS_PATH',42),ee.Filter.notEquals('WRS_ROW',36)))
.filter(ee.Filter.lt('CLOUD_COVER', 45))
//Map a function to mask clouds and negative values
.map(function(img){
var idd = img.id();
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = 1 << 3;
var cloudsBitMask = 1 << 5;
// Get the pixel QA band.
var qa = img.select('pixel_qa');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
// Return the masked image, scaled to reflectance, without the QA bands.
var img2 = img.updateMask(mask).multiply(0.0001).select("B1").rename(idd);
//Mask negative values from images
var mask2 = img2.gt(0);
return img2.multiply(mask2);
})
.toBands()
.clip(table);
Map.addLayer(sur);
var imColl_sur = sur.getInfo().bands;
print(imColl_sur);
print(imColl_sur.length);
for (var i = 0; i < imColl_sur.length; i++) {
//Image Load
var im = sur.select(imColl_sur[i]["id"]);
//var id = imColl_sur[i]["id"];
//var im = ee.Image.load(id);
//Image Properties from original collection
var idl = suro.getInfo().features[i]["properties"]["LANDSAT_ID"];
var st = suro.getInfo().features[i]["properties"]["SENSING_TIME"];
var sza = (suro.getInfo().features[i]["properties"]["SOLAR_ZENITH_ANGLE"])
.toString();
//Download
Export.image.toDrive({
image: im,
description: 'L8_surReflectance_B1_'+idl.slice(10,26)
+st.slice(11,13)+st.slice(14,16)+'_'
+sza.slice(0,2)+sza.slice(3,8),
scale: 30,
region: table,
maxPixels: 1e9
});
}