Using s2cloudless to generate cloud mask using Sentinel-2 L1C raw data

98 views Asked by At

I have downloaded S2 L1C data to generate cloud masks using s2cloudless.

I divide each band by 10,000 to get reflectance, stack the bands and then pass them to s2cloudless to generate the cloud mask. I have previously done this on one tile with no issues.

I have expanded my process to run the code on 30 different date captures and have noticed that the cloud mask results in almost the entire image covered in cloud (false positive), which is not improved with reducing the dilation size in the detector.

I have checked the range of the input bands, some of them have reflectance greater than 1 (raw data would be exceeding 10,000). I think that may be the problem.

What the the appropriate way to process the bands so they are in the correct format (reflectance in 0-1) ?

1

There are 1 answers

0
LeeHHH On

Processing Baseline 04.00 S2 L1C products (2022-01-25) contain an Offset in the metadata.Before storage inside L1C (in a 16 bits integer format), a quantization gain and an offset are applied to the computed TOA reflectance . The transformation of reflectances in 16 bit integers is performed according to the following equation:

L1C_TOA = (L1C_DN + RADIO_ADD_OFFSET) / QUANTIFICATION_VALUE

QUANTIFICATION_VALUE = 10000

RADIO_ADD_OFFSET = -1000