kappazeta / km_predict

S2 full image prediction
Apache License 2.0
21 stars 9 forks source link

Over-estimated semi-transparent class for S2 rasters since 2022 #28

Closed indrek-sunter closed 6 months ago

indrek-sunter commented 6 months ago

Since 2022, per-band RADIO_ADD_OFFSET parameters were introduced in the metadata of S2 L1C and L2A products. Neither km_predict nor cm_vsm accounts for that yet. As a consequence, the semi-transparent class for products since 2022 has been over-estimated.

tanyashtym commented 6 months ago

Starting from processing baseline 4.0 (https://sentinels.copernicus.eu/web/sentinel/technical-guides/sentinel-2-msi/processing-baseline):

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: L1C_TOAi = (L1C_DNi + RADIO_ADD_OFFSETi) / QUANTIFICATION_VALUEi

The offset will be reported in a new field in the General_Info/Product_Image_Characteristics section of the Datastrip and User Product Metadata. This evolution allows avoiding the loss of information due to clamping of negative values in the predefined range [1-32767] occurring over dark surfaces.

To address this issue, the following changes were made to km_predict.

  1. km_predict now verifies the presence of the radiometric_offset list in the MTD_MSIL1C.xml (or MTD_MSIL2A.xml) file. If the offsets are present, they are applied to the normalization parameters and band arrays for each band.

Below are examples of the product "S2B_MSIL1C_20220830T103629_N0400_R008_T33VUE_20220830T112540.SAFE" both without applying the offset and with the offset: Example 1