[GRASS-user] unexpected i.pansharpen results

Eric Goddard egoddard1010 at gmail.com
Thu Jan 31 15:08:58 PST 2013


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:

r.mapcalc "ik_c1r2_f.4 = float(ik_c1r2_mss.4 at PERMANENT)"
r.mapcalc "ik_c1r2_f.3 = float(ik_c1r2_mss.3 at PERMANENT)"
r.mapcalc "ik_c1r2_f.2 = float(ik_c1r2_mss.2 at PERMANENT)"
r.mapcalc "ik_c1r2_f.p = float(ik_c1r2_pan at PERMANENT)"

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:
i.pansharpen sharpen=ihs ms3=ik_c1r2_f.4 at PERMANENT
ms2=ik_c1r2_f.3 at PERMANENTms1=ik_c1r2_f.2 at PERMANENTpan=ik_c1r2_f.p at PERMANENToutput_prefix=ik_ihs_f

running r.info on the output bands from i.pansharpen shows that their range
is still 0-38.

The output image is attached.

Also, there is one small bug in the output. Line 330: grass.message(_("To
visualize output, run: g.region -p rast=%s.red" % out)) -- the %s.red
should be %s_red.

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...



On Thu, Jan 31, 2013 at 3:57 PM, Hamish <hamish_b at yahoo.com> wrote:

> Markus Metz  wrote:
> > But it calls r.mapcalc, e.g. in lines 151-153. If k is
> > integer and not float, r.mapcalc will do integer division.
> > Equivalent for lines 159, 162, 165. This could be fixed by
> > casting the numerator to double with double().
>
> or just put * 1.0 somewhere.
>
>
> is there sample data available showing the problem?
>
>
> Hamish
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130131/ff676ad8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pansharpen.png
Type: image/png
Size: 262153 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130131/ff676ad8/attachment-0001.png>


More information about the grass-user mailing list