I am trying to apply a cloud cover to exclude clouds values from my graphs, using a Sentinel-2 image collection. I know ho to apply to a single image, but if I put an image collection instead of a single image I get this error:
masked: Layer error: Image.select, argument 'input': Invalid type. Expected type: Image. Actual type: ImageCollection.
This is the code:
// Define a location:
var point = ee.Geometry.Point([1.15529,47.034695]); //[Latitude,Longitude]
Map.addLayer(point)
// Load image Collection:
var imageCollection = ee.ImageCollection("COPERNICUS/S2_SR").filterDate('2017-01-01','2017-12-31');
var imageCollection = imageCollection.filterBounds(point);
print(imageCollection)
var cld = require('users/fitoprincipe/geetools:cloud_masks')
Map.addLayer(imageCollection, {bands:['B4', 'B3', 'B2'], min:0, max:5000}, 'test image')
var masked = cld.sclMask(['cloud_low', 'cloud_medium', 'cloud_high', 'shadow'])(imageCollection)
Map.addLayer(masked, {bands:['B4', 'B3', 'B2'], min:0, max:5000}, 'masked')
How can I fix this?