senbox-org / optical-toolbox

SNAP Optical Toolbox
GNU General Public License v3.0
4 stars 4 forks source link

bug: radiometric offsets not applied for Sentinel-2 PSD >= 15 (baseline >=05.11) #65

Open sakvaka opened 1 month ago

sakvaka commented 1 month ago

In Sentinel-2 MSI reader, the radiometric band offsets are only applied if the dataset's Product Specification Document (PSD) version is at least 14.7. The reader handles this internally as "147".

https://github.com/senbox-org/optical-toolbox/blob/c6102dfcffb9dfdcc965b45b206a05a8f8748975/opttbx-s2msi-reader/src/main/java/eu/esa/opt/dataio/s2/ortho/Sentinel2OrthoProductReader.java#L515

However, the newest released PSD is 15 (https://sentinels.copernicus.eu/web/sentinel/-/sentinel-2-product-specification-document-psd-in-version-15.0) and in use since baseline 05.11. The reader handles this version internally as "15", which is interpreted as being less than "147".

https://github.com/senbox-org/optical-toolbox/blob/c6102dfcffb9dfdcc965b45b206a05a8f8748975/opttbx-s2msi-reader/src/main/java/eu/esa/opt/dataio/s2/S2Metadata.java#L532-L539

This causes a level shift in reading Sentinel-2 MSI bands; the radiometric offsets are not applied for the newest operative baseline.

dianaharosa commented 1 month ago

Jira ticket created : https://senbox.atlassian.net/browse/SNAP-3754