<div dir="ltr">I don't think that is the issue. I wasn't using serial processing, and I was using the IHS method. The only place division occurs in the IHS method is in the histmatch function, but that explicitly casts to float.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 31, 2013 at 1:52 PM, Markus Metz <span dir="ltr"><<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.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">On Thu, Jan 31, 2013 at 7:06 PM, Michael Barton <<a href="mailto:Michael.Barton@asu.edu">Michael.Barton@asu.edu</a>> wrote:<br>

><br>
> i.pansharpen uses Python, not Bash. So it is not an integer math problem.<br>
<br>
</div>But it calls r.mapcalc, e.g. in lines 151-153. If k is integer and not<br>
float, r.mapcalc will do integer division. Equivalent for lines 159,<br>
162, 165. This could be fixed by casting the numerator to double with<br>
double().<br>
<br>
Markus M<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> However, you might try changing your input maps to float or DCELL. See if that changes things.<br>
><br>
> Michael<br>
> ______________________________<br>
> C. Michael Barton<br>
> Director, Center for Social Dynamics & Complexity<br>
> Professor of Anthropology, School of Human Evolution & Social Change<br>
> Arizona State University<br>
> Tempe, AZ  85287-2402<br>
> USA<br>
><br>
> voice:  <a href="tel:480-965-6262" value="+14809656262">480-965-6262</a> (SHESC), <a href="tel:480-727-9746" value="+14807279746">480-727-9746</a> (CSDC)<br>
> fax:          <a href="tel:480-965-7671" value="+14809657671">480-965-7671</a>(SHESC), <a href="tel:480-727-0709" value="+14807270709">480-727-0709</a> (CSDC)<br>
> www:  <a href="http://csdc.asu.edu" target="_blank">http://csdc.asu.edu</a>, <a href="http://shesc.asu.edu" target="_blank">http://shesc.asu.edu</a><br>
> <a href="http://www.public.asu.edu/~cmbarton" target="_blank">http://www.public.asu.edu/~cmbarton</a><br>
><br>
> On Jan 31, 2013, at 2:11 AM, <<a href="mailto:grass-user-request@lists.osgeo.org">grass-user-request@lists.osgeo.org</a>><br>
>  wrote:<br>
><br>
> From: Yann Chemin <<a href="mailto:yann.chemin@gmail.com">yann.chemin@gmail.com</a>><br>
> Subject: Re: [GRASS-user] unexpected i.pansharpen results<br>
> Date: January 31, 2013 2:11:33 AM MST<br>
> To: Hamish <<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>><br>
> Cc: GRASS user list <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>><br>
><br>
><br>
> hmmm, yes that looks like an old friend to check...<br>
><br>
><br>
> On 31 January 2013 14:06, Hamish <<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>> wrote:<br>
>><br>
>> (sorry for the html,top posting)<br>
>><br>
>> I wonder if the script is doing integer division when it should be doing floating point division?<br>
>><br>
>> <a href="http://trac.osgeo.org/grass/browser/grass/trunk/scripts/i.pansharpen/i.pansharpen.py" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/scripts/i.pansharpen/i.pansharpen.py</a><br>
>><br>
>><br>
>> Hamish<br>
>><br>
>> --- On Wed, 1/30/13, Eric Goddard <<a href="mailto:egoddard1010@gmail.com">egoddard1010@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> From: Eric Goddard <<a href="mailto:egoddard1010@gmail.com">egoddard1010@gmail.com</a>><br>
>> Subject: [GRASS-user] unexpected i.pansharpen results<br>
>> To: <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
>> Date: Wednesday, January 30, 2013, 8:30 AM<br>
>><br>
>><br>
>> Hi all,<br>
>><br>
>> I'm attempting to pansharpen some ikonos imagery using the i.pansharpen tool in Grass7 on windows 7 installed via OSGeo4W (r54756-478).  The range for the sharpened red, green, and blue outputs are 0-30, which seems suspicious given the 16bit range of the input bands. The command I used was:<br>

>><br>
>> <a href="http://i.pansharpen.py" target="_blank">i.pansharpen.py</a> "sharpen=ihs" "ms3=ik_mss.4@eric" "ms2=ik_mss.3@eric" "ms1=ik_mss.2@eric" "pan=ik_pan@eric" "output_prefix=ik_ihs"<br>

>><br>
>> The input bands are linked via r.external, would that matter?<br>
>><br>
>> The output from my test area is below. Any assistance would be greatly appreciated.<image.png><br>
>><br>
>><br>
>> Thanks,<br>
>> Eric<br>
>><br>
>> -----Inline Attachment Follows-----<br>
>><br>
>> _______________________________________________<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>
><br>
><br>
><br>
> _______________________________________________<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>
><br>
_______________________________________________<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>