<div dir="ltr"><div><div>from the code in trunk:<br><br>       if sproc:<br>            # serial processing<br>            e = '''eval(k = "$ms1" + "$ms2" + "$ms3")<br>                "$outr" = "$ms3" * "$panmatch3" / k<br>
                "$outg" = "$ms2" * "$panmatch2" / k<br>                "$outb" = "$ms1" * "$panmatch1" / k'''<br>            grass.mapcalc(e, outr=outr, outg=outg, outb=outb,<br>
                          panmatch1=panmatch1, panmatch2=panmatch2, panmatch3=panmatch3,<br>                          ms1=ms1, ms2=ms2, ms3=ms3, overwrite=True)<br>        else:<br>            # parallel processing<br>            pb = grass.mapcalc_start('%s_blue = (%s * %s) / (%s + %s + %s)' %<br>
                                (out, ms1, panmatch1, ms1, ms2, ms3),<br>                                overwrite=True)<br>            pg = grass.mapcalc_start('%s_green = (%s * %s) / (%s + %s + %s)' %<br>                                (out, ms2, panmatch2, ms1, ms2, ms3),<br>
                                overwrite=True)<br>            pr = grass.mapcalc_start('%s_red = (%s * %s) / (%s + %s + %s)' %<br>                                (out, ms3, panmatch3, ms1, ms2, ms3),<br>                                overwrite=True)<br>
<br></div>It is a mapcalc process started using Python wrapper lib "grass.script", the process comes to debug a mapcalc command as described by the expression "e" initialized at the beginning of the copied code.<br>
<br></div>Run in it mapcalc with float() casting and see if it is a problem.<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 31 January 2013 23:36, Michael Barton <span dir="ltr"><<a href="mailto:Michael.Barton@asu.edu" target="_blank">Michael.Barton@asu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
i.pansharpen uses Python, not Bash. So it is not an integer math problem. 
<div><br>
</div>
<div>However, you might try changing your input maps to float or DCELL. See if that changes things.</div>
<div><br>
</div>
<div>Michael<br>
<div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:13px;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:13px;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:13px;white-space:normal;font-family:'Lucida Grande';word-spacing:0px">
<div style="word-wrap:break-word">
<div><font face="Helvetica" size="3"><span style="font-size:12px">______________________________</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">C. Michael Barton </span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">Director, Center for Social Dynamics & Complexity</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">Professor of Anthropology, School of Human Evolution & Social Change</span></font></div>
<div><span style="font-size:12px;font-family:Helvetica">Arizona State University</span></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">Tempe, AZ  85287-2402</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">USA</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px"><br>
</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">voice:<span> </span><span style="white-space:pre-wrap">
</span><a href="tel:480-965-6262" value="+14809656262" target="_blank">480-965-6262</a> (SHESC), <a href="tel:480-727-9746" value="+14807279746" target="_blank">480-727-9746</a> (CSDC)</span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px">fax:          <a href="tel:480-965-7671" value="+14809657671" target="_blank">480-965-7671</a>(SHESC), <a href="tel:480-727-0709" value="+14807270709" target="_blank">480-727-0709</a> (CSDC)</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px">www: <span style="white-space:pre-wrap">
</span><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></span></font></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px"><span style="white-space:pre-wrap"></span><a href="http://www.public.asu.edu/%7Ecmbarton" target="_blank">http://www.public.asu.edu/~cmbarton</a></span></font></div>

</div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></span></div>
<br>
<div>
<div>On Jan 31, 2013, at 2:11 AM, <<a href="mailto:grass-user-request@lists.osgeo.org" target="_blank">grass-user-request@lists.osgeo.org</a>></div>
<div> wrote:</div>
<br>
<blockquote type="cite">
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px">

<span style="font-family:Helvetica;font-size:medium;color:rgb(127,127,127)"><b>From:<span> </span></b></span><span style="font-family:Helvetica;font-size:medium">Yann Chemin <<a href="mailto:yann.chemin@gmail.com" target="_blank">yann.chemin@gmail.com</a>><br>

</span></div>
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px">

<span style="font-family:Helvetica;font-size:medium;color:rgb(127,127,127)"><b>Subject:<span> </span></b></span><span style="font-family:Helvetica;font-size:medium"><b>Re: [GRASS-user] unexpected i.pansharpen results</b><br>

</span></div>
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px">

<span style="font-family:Helvetica;font-size:medium;color:rgb(127,127,127)"><b>Date:<span> </span></b></span><span style="font-family:Helvetica;font-size:medium">January 31, 2013 2:11:33 AM MST<br>
</span></div>
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px">

<span style="font-family:Helvetica;font-size:medium;color:rgb(127,127,127)"><b>To:<span> </span></b></span><span style="font-family:Helvetica;font-size:medium">Hamish <<a href="mailto:hamish_b@yahoo.com" target="_blank">hamish_b@yahoo.com</a>><br>

</span></div>
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px">

<span style="font-family:Helvetica;font-size:medium;color:rgb(127,127,127)"><b>Cc:<span> </span></b></span><span style="font-family:Helvetica;font-size:medium">GRASS user list <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>

</span></div><div class="im">
<br style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<div dir="ltr" style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

hmmm, yes that looks like an old friend to check...<br>
</div>
</div><div class="gmail_extra" style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br>
<br>
<div class="gmail_quote"><div class="im">On 31 January 2013 14:06, Hamish<span> </span><span dir="ltr"><<a href="mailto:hamish_b@yahoo.com" target="_blank">hamish_b@yahoo.com</a>></span><span> </span>wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="font:inherit" valign="top"><div class="im">(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<span> </span><b>Wed, 1/30/13, Eric Goddard<span> </span><i><<a href="mailto:egoddard1010@gmail.com" target="_blank">egoddard1010@gmail.com</a>></i></b><span> </span>wrote:<br>
</div><blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(16,16,255);margin-left:5px;padding-left:5px"><div class="im">
<br>
From: Eric Goddard <<a href="mailto:egoddard1010@gmail.com" target="_blank">egoddard1010@gmail.com</a>><br>
Subject: [GRASS-user] unexpected i.pansharpen results<br>
To:<span> </span><a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
Date: Wednesday, January 30, 2013, 8:30 AM
</div><div>
<div><br>
<br>
<div>
<div dir="ltr">
<div>
<div><div class="im">
<div>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 rel="nofollow" href="http://i.pansharpen.py/" target="_blank">i.pansharpen.py</a><span> </span>"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"  <span> </span><br>

<br>
</div>
<div>The input bands are linked via r.external, would that matter?<br>
</div>
<div><br>
</div></div>
The output from my test area is below. Any assistance would be greatly appreciated.<span><image.png></span><br>
<br>
<br>
</div>
Thanks,<br>
</div>
Eric<br>
</div>
</div>
<br>
</div>
</div><div class="im">
-----Inline Attachment Follows-----<br>
<br>
<div>_______________________________________________<br>
grass-user mailing list<br>
<a href="http://mc/compose?to=grass-user@lists.osgeo.org" target="_blank">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></div>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>

<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></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><div>Yann Chemin<br></div><div>Researcher@IWMI<br></div>Skype/FB: yann.chemin<br></div><br></div>
</div>