sentinel-hub / sentinel2-cloud-detector

Sentinel Hub Cloud Detector for Sentinel-2 images in Python
Creative Commons Attribution Share Alike 4.0 International
428 stars 93 forks source link

Applying offset/scaling to L1C data before applying s2cloudless? #36

Closed robbibt closed 2 years ago

robbibt commented 2 years ago

The recent upgrade to Sentinel-2 data introduced band-specific offset/scaling factors for scaling L1C digital numbers to reflectances between 0.0 and 1.0:

Provision of negative radiometric values (implementing an offset):A radiometric offset will be added up to the image reflectance at Level-1C. The dynamic range will be shifted by a band-dependent constant, i.e. RADIO_ADD_OFFSET. From the user’s point of view, the L1C Top of Atmosphere (TOA) reflectance (L1C_TOA) shall be retrieved from the output radiometry as follows: Digital Number DN=0 will remain the “NO_DATA” value For a given DN in [1;215-1], the L1C TOA reflectance value will be: L1C_TOAi = (L1C_DNi + RADIO_ADD_OFFSETi) / QUANTIFICATION_VALUEi

Can I confirm that that these offsets/scaling factors should be applied before running s2cloudless on the L1C data? i.e. should these replace the B_i/10000 rescaling approach described here?

https://github.com/sentinel-hub/sentinel2-cloud-detector#input-sentinel-2-scenes

AleksMat commented 2 years ago

Hi @robbibt, you are correct. If you are loading data from original Sentinel-2 tiles then you have apply these additional harmonization factors for product baselines 04.00 and onward. Thanks for pointing this out, we'll update the readme.

In case you are collecting data from Sentinel Hub service then this is already done by the service according to the documentation.

AleksMat commented 2 years ago

Readme has been updated with a link to instructions provided by ESA. Feel free to reopen in case of any further questions.