<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks very much. This is a definite help. I somehow missed the align argument in g.region. So, whatever reason for this shift, this seems to be a very good way around it. Works great!<div><br></div><div>Michael<br><div><br></div><div><br></div><div><br><div><div>On Jun 8, 2012, at 1:00 PM, <<a href="mailto:grass-dev-request@lists.osgeo.org">grass-dev-request@lists.osgeo.org</a>></div><div> <<a href="mailto:grass-dev-request@lists.osgeo.org">grass-dev-request@lists.osgeo.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgb(127, 127, 127); "><b>From:<span class="Apple-converted-space"> </span></b></span><span style="font-family: Helvetica; font-size: medium; ">Markus Metz <<a href="mailto:markus.metz.giswork@googlemail.com">markus.metz.giswork@googlemail.com</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgb(127, 127, 127); "><b>Date:<span class="Apple-converted-space"> </span></b></span><span style="font-family: Helvetica; font-size: medium; ">June 8, 2012 12:53:57 PM MDT<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgb(127, 127, 127); "><b>To:<span class="Apple-converted-space"> </span></b></span><span style="font-family: Helvetica; font-size: medium; ">Michael Barton <<a href="mailto:michael.barton@asu.edu">michael.barton@asu.edu</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgb(127, 127, 127); "><b>Cc:<span class="Apple-converted-space"> </span></b></span><span style="font-family: Helvetica; font-size: medium; "><<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgb(127, 127, 127); "><b>Subject:<span class="Apple-converted-space"> </span></b></span><span style="font-family: Helvetica; font-size: medium; "><b>Re: [GRASS-dev] shifting maps created with r.mapcalc</b><br></span></div><br><br>On Fri, Jun 8, 2012 at 8:26 PM, Michael Barton <<a href="mailto:michael.barton@asu.edu">michael.barton@asu.edu</a>> wrote:<br><blockquote type="cite">I've run into an odd issue that could be a problem for anyone needing precise calculations from a landsat (or possibly other) image.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I have a landsat ETM image with a resolution of 28.5m for the bands 1-5, 7 and resolution of of 14.25m for band 8. If I set the region to exactly match one of the landsat channels (g.region rast=landsat_band8, for example) and copy the image with r.mapcalc (r.mapcalc expression='new_band8=landsat_band8'), GRASS produces an exact copy.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">However, if I set the region in other ways (e.g., via g.region setting the bounds, interactively in the GUI) any copy of the image made with r.mapcalc is shifted by half a cell. This happens whether or not I set the -a (align) flag.<br></blockquote><br>Since r.mapcalc operates on the current region, and r.mapcalc produces<br>a correct result with g.region rast=landsat_band8, I would recommend<br>not to use the -a flag, but use g.region align=landsat_band8 after<br>setting the region in other ways. The GUI can not make use of the<br>align option itself because it does not know how the previous region<br>has been set.<br><br>HTH,<br><br>Markus M<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">This does not seem to be a problem for another landsat with a 15m resolution (that is, not a fraction of a meter).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Has anyone else run into this? Any ideas?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm working with GRASS 7 compiled a couple days ago.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Michael<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jun 8, 2012, at 1:26 AM, Markus Neteler wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">This is definitely for grass-dev. Perhaps an issue in the Python interface?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">But it would be important to know what " if I set the region any other way"<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">exactly means.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Markus<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Fri, Jun 8, 2012 at 6:54 AM, Michael Barton <<a href="mailto:michael.barton@asu.edu">michael.barton@asu.edu</a>> wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">In trying to figure out why I was getting some odd results in the sharpening<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">algorithms, I discovered a weird problem.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I've zoomed in on a landsat to run the pan sharpening routines faster (to<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">test various changes in the code) and see in better detail the results. When<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I make a copy of the panchromatic map, I find that the copy is shifted by<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1/2 cell from the original. If I set region to exactly match all of the pan<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">map (g.region rast=pan), there is no shift. But if I set the region any<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">other way, there is a 1/2 cell shift. This means that every map I make will<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">not align with my original landsats. This causes problems in the sharpening<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">algorithms in different places. The worst seems to be in the PCA<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">sharpening. I've quit GRASS and restarted and this shift is still there. It<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">doesn't seem to matter whether I use the -a flag or not in g.region.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Is this a known issue? Is there some way around it?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Michael<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_____________________<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">C. Michael Barton<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Visiting Scientist, Integrated Science Program<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">National Center for Atmospheric Research &<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">University Consortium for Atmospheric Research<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">303-497-2889 (voice)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Director, Center for Social Dynamics & Complexity<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Professor of Anthropology, School of Human Evolution & Social Change<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Arizona State University<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">www:<span class="Apple-converted-space"> </span><a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>,<span class="Apple-converted-space"> </span><a href="http://csdc.asu.edu/">http://csdc.asu.edu</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_____________________<br></blockquote><blockquote type="cite">C. Michael Barton<br></blockquote><blockquote type="cite">Visiting Scientist, Integrated Science Program<br></blockquote><blockquote type="cite">National Center for Atmospheric Research &<br></blockquote><blockquote type="cite">University Corporation for Atmospheric Research<br></blockquote><blockquote type="cite">303-497-2889 (voice)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Director, Center for Social Dynamics & Complexity<br></blockquote><blockquote type="cite">Professor of Anthropology, School of Human Evolution & Social Change<br></blockquote><blockquote type="cite">Arizona State University<br></blockquote><blockquote type="cite">www:<span class="Apple-converted-space"> </span><a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>,<span class="Apple-converted-space"> </span><a href="http://csdc.asu.edu/">http://csdc.asu.edu</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">grass-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br></blockquote><blockquote type="cite"><a href="http://lists.osgeo.org/mailman/listinfo/grass-dev">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br></blockquote><br></span></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: 12px; ">_____________________</span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="font-size: 12px; ">C. Michael Barton</div><div style="font-size: 12px; ">Visiting Scientist, Integrated Science Program</div><div style="font-size: 12px; ">National Center for Atmospheric Research &</div><div style="font-size: 12px; ">University Corporation for Atmospheric Research</div><div style="font-size: 12px; ">303-497-2889 (voice)</div><div style="font-size: 12px; "><br></div><div style="font-size: 12px; ">Director, Center for Social Dynamics & Complexity </div><div style="font-size: 12px; ">Professor of Anthropology, School of Human Evolution & Social Change</div><div style="font-size: 12px; ">Arizona State University</div><div style="font-size: 12px; ">www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>, <a href="http://csdc.asu.edu">http://csdc.asu.edu</a></div></div></div></span></div></span></div></span></div></span></span>
</div>
<br></div></div></body></html>