I am using Google Earth Engine. I just realized though, that "CLOUDY_PIXEL_PERCENTAGE" is a value assigned to an image, not to every single pixel, so I think that what was in my mind can not be done (in the way I wanted). But know a question reaches my mind... A cloud mask in Sentinel 2 is done by using band "QA60". But... what the pixel values within this band represent? The lower the value of QA60 for a pixel, the lower it is that pixel affected by clouds? I thought about constructing a mean composite of the values of that band, which hopefully will represent some "cloudiness index"
– Enrique CasasNov 29 '18 at 18:09

1 Answer
1

On EARTH ENGINE, if u want to check a pixel for cloud, you can use the QA60 band of the Sentinel-2 image.

The QA60 band is meant to be read in binary form. In its binary form, the 10th bit( 0 or 1 ) represents whether the pixel has cloud or not, whereas the 11th bit ( 0 or 1 ) represents whether the pixel has cirrus clouds or not.

The below code will return you a raster image of the same footprint as your original image with pixel values 1 or 0, where 1 denotes that the pixel contains cloud and 0 otherwise.