EnMAP-Box / enmap-box

EnMAP-Box source code repository. See https://enmap-box.readthedocs.io for documentation
GNU General Public License v3.0
36 stars 16 forks source link

add algorithm for scaled reflectance encoding #978

Open janzandr opened 1 month ago

janzandr commented 1 month ago

Discussed with @jakimowb.

After importing satellite data into the EnMAP-Box, reflectance data is scaled between 0 and 1. Exporting this data into GTiff or ENVI file, would result in floating-point data. It is proposed to implement an algorithm for storing a raster using an integer data type using scaled reflectance encoding (e.g. multiply the data by 10000 and cast it to Int16).

The following parameters are describing a scaled reflectance encoding:

jakimowb commented 4 weeks ago

It would be nice that saving such scaled data does preserve the original data types used. E.g. if data is int + scaling, the export algorithm should try the same.

janzandr commented 3 weeks ago

With "export algorithm" you mean the "Save raster layer as" / "Translate raster layer" algo?

jakimowb commented 3 weeks ago

Yes.

janzandr commented 3 weeks ago

Both algos use gdal_translate, which preserves the data type and the scaling factor.

janzandr commented 3 weeks ago

BUT, if you are using any other algo for processing the data, the data is read by QGIS API, which will scale the data on-the-fly.

jakimowb commented 3 weeks ago

After importing satellite data into the EnMAP-Box, reflectance data is scaled between 0 and 1 Probably not the scope of this issue, but do our import algos perform a "hard scale", i.e. writing double instead ints?

janzandr commented 3 weeks ago

After importing satellite data into the EnMAP-Box, reflectance data is scaled between 0 and 1 Probably not the scope of this issue, but do our import algos perform a "hard scale", i.e. writing double instead ints?

No, the data is stored as ints with scaling factors. USING the data in QGIS will on-the-fly scale the data into 0 to 1 floats.