<div dir="ltr"><div><div>Alright, I'm at home on my linux box running grass7, still with the same issue. I converted the inputs for my test area to float:<br><br>r.mapcalc "ik_c1r2_f.4 = float(ik_c1r2_mss.4@PERMANENT)"<br>
r.mapcalc "ik_c1r2_f.3 = float(ik_c1r2_mss.3@PERMANENT)"<br>r.mapcalc "ik_c1r2_f.2 = float(ik_c1r2_mss.2@PERMANENT)"<br>r.mapcalc "ik_c1r2_f.p = float(ik_c1r2_pan@PERMANENT)"<br><br></div>and set the color table to grey for each one. (I also remembered to change region to reflect the higher resolution of the pan image). I then ran i.pansharpen:<br>
i.pansharpen sharpen=ihs ms3=ik_c1r2_f.4@PERMANENT ms2=ik_c1r2_f.3@PERMANENT ms1=ik_c1r2_f.2@PERMANENT pan=ik_c1r2_f.p@PERMANENT output_prefix=ik_ihs_f<br><br></div>running <a href="http://r.info">r.info</a> on the output bands from i.pansharpen shows that their range is still 0-38.<br>
<div><div><br></div><div>The output image is attached.<br><br></div><div>Also, there is one small bug in the output. Line 330: grass<span class="">.</span>message<span class="">(</span>_<span class="">(</span><span class="">"To visualize output, run: g.region -p rast=</span><span class="">%s</span><span class="">.red"</span> <span class="">%</span> out<span class="">)) -- the %s.red should be %s_red.<br>
<br></span></div><div><span class="">I've tried using the PCA algorithm and the output looks the same, though the range is different. Later on I'll try with different imagery and see what happens...<br></span></div>
<div><div><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 31, 2013 at 3:57 PM, Hamish <span dir="ltr"><<a href="mailto:hamish_b@yahoo.com" target="_blank">hamish_b@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Markus Metz wrote:<br>
> But it calls r.mapcalc, e.g. in lines 151-153. If k is<br>
> integer and not float, r.mapcalc will do integer division.<br>
> Equivalent for lines 159, 162, 165. This could be fixed by<br>
> casting the numerator to double with double().<br>
<br>
</div>or just put * 1.0 somewhere.<br>
<br>
<br>
is there sample data available showing the problem?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Hamish<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div><br></div>