[GRASS-dev] [GRASS GIS] #3210: r.texture: bug when non continuous series of values

GRASS GIS trac at osgeo.org
Wed Nov 23 04:54:05 PST 2016


#3210: r.texture: bug when non continuous series of values
--------------------------+-------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  reopened
  Priority:  normal       |  Milestone:  7.2.0
 Component:  Raster       |    Version:  svn-trunk
Resolution:               |   Keywords:  r.texture
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mlennert):

 Replying to [comment:20 mlennert]:
 >And MOC-2 doesn't give any result (0 everywhere) in both versions.

 Trying to debug this, I am a bit stumped. Using the following debug patch:


 {{{
 Index: h_measure.c
 ===================================================================
 --- h_measure.c (révision 69876)
 +++ h_measure.c (copie de travail)
 @@ -669,7 +669,9 @@
         }
      }

 -    /* fprintf(stderr,"hx=%f\thxy2=%f\n",hx,hxy2); */
 +    fprintf(stderr, "1-exp() = %f\n", (1 - exp(-2.0 * (hxy2 - hxy))));
 +    fprintf(stderr, "abs() = %f\n", abs(1 - exp(-2.0 * (hxy2 - hxy))));
 +    fprintf(stderr, "sqrt() = %f\n", sqrt(abs(1 - exp(-2.0 * (hxy2 -
 hxy)))));
      return (sqrt(abs(1 - exp(-2.0 * (hxy2 - hxy)))));
  }

 }}}

 I get results such as:


 {{{
 ...
 1-exp() = 0.994315
 abs() = 0.994315
 sqrt() = 0.000000
 1-exp() = 0.993262
 abs() = 0.993262
 sqrt() = 0.000000
 1-exp() = 0.994315
 abs() = 0.994315
 sqrt() = 0.000000
 1-exp() = 0.993262
 abs() = 0.993262
 sqrt() = 0.000000
 ....
 }}}

 So something seems to be wrong in the sqrt() calculations. However, when I
 comment out the first fprintf() in the above patch, I get this:


 {{{
 abs() = 0.000000
 sqrt() = 0.000000
 abs() = 0.000000
 sqrt() = 0.000000
 abs() = 0.000000
 sqrt() = 0.000000
 abs() = 0.000000
 sqrt() = 0.000000
 abs() = 0.000000
 sqrt() = 0.000000
 }}}

 No idea how to interpret this behaviour.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3210#comment:21>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list