I'm trying to filter clouds over a specific region for an NDVI time series using Landsat collection 2.
I tried filtering with simple cloud score but it doesn't seem to work (maybe because there is no simpleCloudScore?).
Here's part of my full code:
var extent =
/* color: #44c239 */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[35.66951628813774, 33.212344469176244],
[35.66951628813774, 33.18720738523013],
[35.69560881743462, 33.18720738523013],
[35.69560881743462, 33.212344469176244]]], null, false);
// Applies scaling factors for LS 457.
function applyScaleFactors457(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);
}
var startdate = '2000-08-01';
var enddate= '2021-08-01';
var LS7Collection = ee.ImageCollection('LANDSAT/LE07/C02/T1_L2')
.filterBounds(extent)
.filterDate(startdate, enddate)
.map(applyScaleFactors457);
//filer clouds by region ????
var c = LS7Collection.filterBounds(extent);
var withCloudiness = c.map(function(image) {
var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');
var cloudiness = cloud.reduceRegion({
reducer: 'mean',
geometry: extent,
scale: 30,
});
return image.set(cloudiness);
});
var LS7Collection = withCloudiness.filter(ee.Filter.eq('cloud', 0));
print(LS7Collection);
Link to the full code: https://code.earthengine.google.com/?scriptPath=users%2Ftomcol%2Fpersonal%3ANDVI%20SERIES%20LANDSAT%207