sen2r icon indicating copy to clipboard operation
sen2r copied to clipboard

Wrong sen2r outputs from new SAFE baseline 04.00 -> fixed in GitHub version 1.5.1.9000

Open ranghetti opened this issue 3 years ago • 2 comments

In short:

the issue described below was fixed in GitHub version 1.5.1.900, not in CRAN version. For this reason, update sen2r using the command remotes::install_github("ranghetti/sen2r") in order to use recent SAFE products (>= 04.00). sen2r CRAN version 1.5.1 can be safely used only with products <= 2021.

Issue description

Due to changes occurred in SAFE format from baseline 04.00 (see details), sen2r outputs (reflectances, indices and RGB images) computed on images newer than 25th January 2022 are wrong.

In particular, reflectance values are shifted by a factor of 0.1 (e.g. a reflectance of 3.5 is returned instead of 2.5), and index values are subjected to non-constant differences (depending on each index formula).

To manage this change il will be necessary to consider the SAFE baseline and, for versions > 04.00, read the RADIO_ADD_OFFSET (L1C) or BOA_ADD_OFFSET (L2A) from metadata and apply them to jp2 reflectance values.

The development of the package is closed due to career change of the maintainer, so it is not possible to announce when the new SAFE baseline will be correctly managed. For now, do not use the package to produce outputs newer than 25th January 2022.

ranghetti avatar May 13 '22 15:05 ranghetti

Hi Luigi,

#444 solves this, right? Can be closed?

Thank you so much for your great work!

markolipka avatar Jun 19 '22 06:06 markolipka

@markolipka yes, the bug was fixed in version 1.5.1.9000. I updated the title and the description, since I prefer leaving this issue open (this because CRAN version is still bugged and thus it is useful that this issue can be easily found).

ranghetti avatar Jun 20 '22 06:06 ranghetti

The new version 1.5.2 which includes this important patch is ready, but unfortunately CRAN maintainers are rejecting the re-submission because of a segmentation fault occurred on Prof. Ripley's machine, although all other checks - including macbuilder - are correctly running. Hoping this annoying stalemate can get solved.

ranghetti avatar Sep 17 '22 06:09 ranghetti

Version 1.5.3, which includes this important patch, is on CRAN.

ranghetti avatar Sep 22 '22 15:09 ranghetti