sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
278 stars 22 forks source link

Round values from reprojected data #105

Open remi-braun opened 1 year ago

remi-braun commented 1 year ago

There is currently a blind spot with reflectance values coming from reprojected data.

For example, the loading workflow is usually:

Read (in float) > Reproject (bilinear) > Scale > Convert to float32

The issue with this workflow is that the bilinear reprojection (with float data) creates values with more precision than intended (i.e. for Sentinel-2, the precision is 10^-5). This could introduce biases, especially when computing spectral indices.

It may exist a need of the community to round those values (see #103). If it does, this modification shouldn't be too complicated.