I am trying to perform cloud masking of my study area, in Google Earth Engine, for LANDSAT-8 Tier 1 image collection, for my ROI. I found this interesting StackOverflow question which looks into this same issue. I used the same snippet of code for cloud removal, but unfortunately, the clouds of my ROI did not get cleared. Where did it go wrong?
This is the ROI
var ROI =
/* color: #d6d3d2 */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[82.12628415166101, 17.03508764088917],
[82.12628415166101, 16.499924353159972],
[82.37484982548914, 16.499924353159972],
[82.37484982548914, 17.03508764088917]]], null, false)
And this is the code snippet
//load images for composite
var sr14= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(ROI) //ROI
.filterDate('2019-03-01','2019-03-31')
//.select(['B4','B3','B2']); // if you select those bands you loose BQA band
// Temporally composite the images with a maximum value function.
var composite = sr14.max();
//Map.setCenter(35.8244, -3.5799);
var vis = {bands:['B4','B3','B2'],min:0, max:3000}
Map.addLayer(composite, vis, 'max value composite');
var mask = require('users/fitoprincipe/geetools:cloud_masks')
print(mask.help['landsatSR'])
var mask_function = mask.landsatSR() // mask function
var col_free = sr14.map(mask_function) // apply function to collection
var composite_free = col_free.max() // create composite using max
Map.addLayer(composite_free, vis, 'composite collection without clouds');
Here is the code