Opened 8 years ago
Last modified 5 years ago
#3269 new defect
r.roughness.vector: bug in rescale formula
Reported by: | sbl | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | Addons | Version: | |
Keywords: | r.roughness.vector | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
There is a little bug in the formula that produces the "Fischers K" output (line 317). "- 1" should not be in there.
Attachments (1)
Change History (12)
by , 8 years ago
Attachment: | rescale_formula.diff added |
---|
comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
Yes, same issue there. For what I can see, line 265 in https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector.sh should be changed equally like this:
- r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window - 1)" + r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window)"
Result should be scaled from 0 to 1. Thus formula should be:
V' = (max(V[i-j]) - V) / max(V[i-j]
comment:3 by , 8 years ago
Replying to sbl:
Yes, same issue there. For what I can see, line 265 in https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector.sh should be changed equally like this:
- r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window - 1)" + r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window)"Result should be scaled from 0 to 1. Thus formula should be:
V' = (max(V[i-j]) - V) / max(V[i-j]
Could you ping Carlos, the author of both addons, regarding this issue?
comment:4 by , 8 years ago
Hi there, sorry for the late reply.
I went looking in the paper by Hobson (1972), and the original formula for Fischer K is: (N-1)/(N-R), but in the module (and in my paper) I used the *inverse* of it (so smooth areas would end up with a low value). Inverting the formula gives (N-R)/(N-1).
comment:5 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:8 by , 7 years ago
Milestone: | → 7.2.4 |
---|
comment:10 by , 6 years ago
Component: | Default → Addons |
---|---|
Keywords: | AddOn removed |
Milestone: | 7.2.4 |
Version: | unspecified |
comment:11 by , 5 years ago
Milestone: | → 7.8.3 |
---|
Replying to sbl:
It's a port of g6 addon: https://grass.osgeo.org/grass64/manuals/addons/r.roughness.window.vector.html
Could you have a look how the calculation is there?