Sen2Cor-2.5.5 result reflectance too large


#1

I run Sen2Cor L2A_Process.bat to produce L2A products of Sentinel-2 , and it works. But the result reflectance value is so large. When I calculate NDVI by gdal_calc.py after resample B8 to 20m, the result NDVI values range from 0 to ~800.
gdal_calc.py -A B8_20m.jp2 -B B4_20m.jp2 --format=GTiff --outfile=NDVI.tif --calc="(B - A)/(B + A)"
When I change the script to below, I got reasonable NDVI values of [0, 1]
gdal_calc.py -A B8_20m.jp2 -B B4_20m.jp2 --format=GTiff --outfile=NDVI.tif --calc="(B /10000.0- A/10000.0)/(B/10000.0 + A/10000.0)"

But @ABraun in sen2cor-reflectance-values/3805 post that

The Sen2Cor result data is stored as integer but SNAP interprets it as floats (value divided by 10.000)

I am wondering why it is 10.000 but not 10000.0?

Very grateful for the help!


#2

sorry, this is probably a matter of syntax. In Germany, we use the point to delimit numbers larger than thousand and the comma to delimit decimals. In the rest of the world it is the opposite.

So with 10.000 i actually meant 10000.

So I think you have made everything right. Dividing the pixels by 10000 makes them float values and results in a correct division. Dividing integers results in false results.


#3

Thanks for your quick reply, and you let me know the special usage of Komma(,) and Punkt(.) in Germany, I think its interesting.