Read "reflectance scale factor" field in hdr files

Issue #938 resolved
Agustin Lobo created an issue

It would be very convenient that the Spectral Library would automatically apply the "reflectance scale factor" field in hdr file, if present. In this way, we could collect spectra from images with different scaling between DN and reflectance.

see https://www.l3harrisgeospatial.com/docs/ENVIHeaderFiles.html

Comments (12)

  1. Andreas Janz

    I also thought about that. How would that play together with:

    data gain values, data offset values, data reflectance gain values, and data reflectance offset values ?

  2. Agustin Lobo reporter

    I have never seen those actually used, instead the reflectance scale factor is very common. Perhaps you might implement

    as they are requested? I can also do a bit of googling on these terms and see what I find. Somehow I recall something like that for Hyperion imagery.

  3. Andreas Janz

    For me it is the opposite. I wasn’t aware of the reflectance scale factor, while having seen the data gain/offset values from time to time.

  4. Andreas Janz

    But I’m not so sure about using the reflectance scale factor, because ENVI isn’t using it either it looks like:

    Any idea why that is? Am I doing something wrong in ENVI?

  5. Agustin Lobo reporter

    Maybe you have to re-read the file? Note this field would get written to the hdr as Reflectance Scale Factor = 10000.000

    I have no envi to test…

  6. Andreas Janz

    I set the value outside and opened the file afterwards in ENVI. I’m quite sure ENVI isn’t using the scale factor.

    With that in mind: it’s quite correct behaviour that GDAL/QGIS also isn’t applying the scale factor right away, i guess.

    Having said that. There is an easy way to scale your data via the new Band Properties widget:

  7. Andreas Janz

    When selecting an ENVI source, the “reflectance scale factor” from the ENVI header can be set as band scale.

    Note that GDAL Band Scale = 1 / ENVI Reflectance Scale Factor.

  8. Log in to comment