<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="+1">Hello all,<br>
      working with GRASS GIS 7.0.1svn (r65198) @Linux, I noticed, that
      when importing two Landsat images from different dates, I often
      get them spatially shifted to each other when comparing them in
      detail - meaning when you zoom in to about 1:5000 scale and switch
      the viewed bands, the features in the map jump by a fraction of
      pixel size. For Landsat 8 images LC81910252013208 (reflectance
      product) and LC81910252013224 (DN product) the shift is about 15m
      (half the pixel size) in both horizontal and vertical direction.
      The same two products imported in GRASS 6.4.4 have no visible
      shift at all and the corresponding pixels seem to be perfectly
      aligned.<br>
    </font><font size="+1"><br>
      The procedure to reproduce this:<br>
      <br>
      1)Download and uncompress this archive (133 MB):<br>
<a class="moz-txt-link-freetext" href="https://dl.dropboxusercontent.com/u/24062833/pixel_shift_208_224.zip">https://dl.dropboxusercontent.com/u/24062833/pixel_shift_208_224.zip</a><br>
      <i><br>
        The archive contains band 5 of the two above mentioned Landsat
        scenes, where the one with DOY 208 (the last number of the scene
        code, day-of-year) is from surface reflectance (SR) product, the
        other with DOY 224 is digital number (DN) product (I work on a
        script to atmospherically correct DN product based on reference
        SR image)</i><i>.</i><i><br>
      </i><br>
      <br>
    </font><font size="+1">2) Start GRASS 7, create new mapset in
      location with UTM 33N (EPSG:32633) spatial reference system.<br>
      <br>
      3) Import each image, open them in the map, set colors, zoom in
      and compare a distinct feature placement in detail:<br>
      <br>
      #import<br>
      r.in.gdal input="/path/to/data/LC81910252013208LGN00_sr_band5.tif"
      output=208_grass7<br>
    </font><font size="+1"><font size="+1">r.in.gdal
        input="/path/to/data/LC81910252013224LGN00_B5.TIF"
        output=224_grass7<br>
        <br>
        #set the null pixels of the DN band (helps the bands to get
        similar color palette in the next step)<br>
        r.null map=224_grass7 setnull=0<br>
        <br>
        #set colors:<br>
        r.colors map=</font></font><font size="+1">208_grass7<br>
    </font><font size="+1"><font size="+1"><font size="+1"><font
            size="+1">r.colors map=</font></font><font size="+1"><font
            size="+1"><font size="+1"><font size="+1">224_grass7</font></font></font></font><br>
        <br>
      </font></font><br>
    <font size="+1"><font size="+1"><font size="+1"><font size="+1">4)
            Zoom in to a distinct feature in about 1:5000 scale </font></font></font></font><font
      size="+1"><font size="+1"><font size="+1"><font size="+1"><font
              size="+1"> (I have used a pond at coordinates
              542365,554675)</font></font></font>, switch visibility of
        both images on, then repeatedly switch on/off the upper image in
        the stack. You should see the shift quite clearly. Zooming in
        even more, it is possible to measure the shift.<br>
        <br>
        Repeat the steps 3,4 in GRASS 6 (6.4.4/Linux in my case)
        importing as </font></font><font size="+1"><font size="+1"><font
          size="+1">208_band5_grass6, </font><font size="+1"><font
            size="+1">224_band5_grass6</font></font>. The result is (for
        me) </font></font><font size="+1"><font size="+1">that files </font></font><font
      size="+1">208_grass7, 208_grass6, 224_grass6 are perfectly
      aligned, while 224_grass7 is off about 15m east and 15m south from
      the rest (seems it is exactly half pixel size)...<br>
      <br>
      I tried if region settings prior the import affects this, it seems
      not. Also the problem is always exactly the same when trying
      several times, creating new mapset or not.<br>
      I also tried if the images are shifted when the tiffs are opened
      directly in QGIS - they are not.<br>
      I also tried to download JPEG quicklook products of the above
      mentioned scenes (created both from DN product, JPEG color format)
      and the results are not shifted.<br>
      <br>
    </font><br>
    <font size="+1"><font size="+1">As I use the images in change
        detection, the shift causes that especially linear no-change
        features (like highways, runways) are not detected as no-change.<br>
        <br>
      </font>Now, any ideas why is that, and why it is so in GRASS7 and
      not in GRASS6?<br>
      <br>
      Tomas B.<br>
    </font>
  </body>
</html>