<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
    <style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
    text="#000000">
    Hi Nikos:<br>
    Maybe you have some additional tips for me on this problem using
    i.atcorr with Landast 8.<br>
    <br>
    <div class="moz-cite-prefix">On 05/23/2015 04:26 PM, Nikos
      Alexandris wrote:<br>
    </div>
    <blockquote cite="mid:20150523132605.GA8558@tpx1c2g" type="cite"><br>
      <blockquote type="cite">
        <pre wrap="">So, do I need to read the Min and Max radiance for each band separately
from the MTL file, and use those as the range= parameter?
</pre>
      </blockquote>
      <pre wrap="">
Micha, I now see what the concern is.

If I understand it correctly, in the case of spectral radiance (default
input type for i.atcorr) as input, I would simply use the min, max values of the
images themselves.

For reflectances (-r flag for i.atcorr) I think I would use [0, 1.0]. In
addition, (as I have done in the past) one can flatten, all values > 1.0
to 1.0 (as they normally are --should be, imho-- erroneous large
outliers).

I have to look closer at what I did in my script (see:
<a class="moz-txt-link-freetext" href="https://github.com/NikosAlexandris/i.landsat.atcorr/blob/master/i.landsat.atcorr.py#L371">https://github.com/NikosAlexandris/i.landsat.atcorr/blob/master/i.landsat.atcorr.py#L371</a>)
and fix it (currently broken). But, I do read the min and max values
from the images that are going to be processed.
</pre>
    </blockquote>
    <br>
    I looked thru your script and tried several combinations of
    "range=..." and "rescale=..." parameters. First I read the min/max
    values of all bands (r.info -r) and put these with each band's
    raster name into a text file for easy access in a script.<br>
    Then I tried:<br>
    1) rescale=0,1 : result was indeed values between 0-1 (reflectance
    as expected) but the histgrams were all wrong. Almost all pixels got
    value << 0.005. All values from 0.01 - 1.0 were only a very
    small number of pixels. If I tired to get an RGB composite from
    bands 4,3,2 it looked pychedelic.<br>
    <br>
    2) rescale set to the same range as each raster's min/max values. In
    this case some of the resulting histograms looked fine. And if I
    display the RGB composite of bands 4,3,2 after i.atcorr I get nice
    bright images, with even better contrast than the toar raster (as
    expected). However values are *not* between 0-1.  <br>
    <br>
    So can you guess what is correct? Should I just "normalize" the
    values resulting from (2) above by manually rescaling to 0-1?<br>
    <br>
    Any tips are appreciated.<br>
    <br>
    Best,<br>
    Micha<br>
    <br>
    <blockquote cite="mid:20150523132605.GA8558@tpx1c2g" type="cite">
      <pre wrap="">

At least in the case of Landsat8 imagery, the script worked well (before
it went broken :-p).

</pre>
      <blockquote type="cite">
        <pre wrap="">The default of "0,255" seems to be too small.
</pre>
      </blockquote>
      <pre wrap="">
I agree.  Furthermore, I think the current default 8-bit range for the output spectral
reflectances (i.atcorr *always* delivers reflectances) is (was) like a standard
for which many modules would simply do their job while they would fail
in case of floating point numbers or larger ranges. I think we should
communicate and maybe ask for it to change that the "normal" range for
reflectance is zero to one. And depending on how rich was the input,
simply rescaling to 8-bit comes with cost of loosing fine radiometric
details.



</pre>
    </blockquote>
    <br>
  </body>
</html>