Cloud masking Sentinel 2 Level 2A

Hi all. I am looking for an effective method that can be launched as a terminal to mask clouds from Sentinel 2’s L2A products. What do you think are the best methods? Considering the importance of gdal, can python be a good alternative?

If you first want to visualize what cloud masking will look like for L2 products of your site
you can visit the EOB Browser and and switch between True Color and Scene Classification.

As you can see there can be a ‘grey area’ whereby misty atmosphere is not always classified as cloud - but is still enough to mess up the spectral radiance.

Thanks for the suggestion, I would like to have some images already available, I am trying to exclude the clouds and bring the resolution to 10 m. I’m also using sen2cor but I’m finding this problem, do you have any idea how to solve it?

have you seen this? TypeError: object of type 'NoneType' has no len()

Besides that - if you want to compute sen2cor at full resolution, you don’t need to specify --resolution 10

described here:

Yeah, I’ve seen that topic before, but it didn’t work for me. The mistake remains the same.

have you tried moving the L1C folder to a shorter path?

Yes, but I don’t have L1C but L2A products available.

you cannot apply sen2cor to L2A products.

sen2cor turns L1C products into L2A.

I’m sorry, you’re right, I deflected my goal which is to mask the clouds on L2A products and bring them to 10m resolution, is it possible with sen2cor as a terminal or are there better solutions?

automatic cloud masks are stored in L2A products and you can use them to mask the image: Cloud and water mask out

You can also perform Idepix analysis to detect clouds with it: Cloud shadow detection problem