Cloud mask for SLSTR lavel1B image


how can i get pixel wise cloud information for SLSTR lavel 1B images. I can see has cloud_in. but what does the number signify. how to tell if the pixel is cloudy or not. Any document would be helpful. I am trying to screen cloudy pixel over Dome C.


If you open the xfdumanifest.xml instead of the *.nc files in SNAP you are provided with the necessary information.
Also, the SLSTR Document Library is probably useful for you.


Thank you. I have more than 1000’s images and opening each image through SNAP is not helpful. Is there any python (simple code) that i can use to get the information about the cloud information for SLSTR lavel 1B images.



you can access the netcdf variables through python’s netcdf library, e.g.:

data = netCDF4.Dataset(YOURFILENAME, 'r', 'NETCDF4').variables['cloud_in'][:]
if isinstance(data,
    data =

this will provide the flags “summarized” into one integer value per pixel. That is, for accessing the mask layers, represented by individual bits, you have to disentangle the integer value into its bits. I do that by:


flags is then an array of dimensions NxImage,NyImage,NFlagbits (i have made this and tested it only for 16-bit flags. might need some adaptations for other number of bits).

there might be (better) ways to do this through snappy, of course…


Thanks. But information upto 8( bits are only provided. How can i interpret the meaning ??

3 0 clear Indicates cloud-free pixels.
3 1 shadow Indicates pixels shadowed by clouds.
3 2 uncertain Indicates uncertain cloud detection.
3 3 cloud Indicates cloudy pixels.
4 4 ice_or_snow Indicates ice or snow.
8 8 land Indicates land.
16 16 MIR_good Quality of MIR measurement is good.
32 32 B3_good Quality of B3 measurement is good.
64 64 B2_good Quality of B2 measurement is good.
128 128 B0_good Quality of B0 measurement is good.


The link you shared is for level-2 SYN data not for SLSTR level-1 data.

Maybe the following two links shine some light on your question.


Hi I just started looking into snappy. Can someone help me identify the cloudy pixel for SLSTR L1B product using snappy. A small code snippet would be great.