[GRASS-user] r.width.funct in correct version

Margherita Di Leo diregola at gmail.com
Tue Mar 5 02:50:22 PST 2019


Hi,

I could not reproduce the error. To me the example just works, there are
only some deprecation warnings.

r.width.funct map=dist2out image=test
 100%
Tot. cells 88407.0
Tot. area 8840700.0
Max distance 7714.591101
/usr/lib64/python2.7/site-packages/matplotlib/cbook.py:136:
MatplotlibDeprecationWarning: The WX backend is deprecated. It's untested
and will be removed in Matplotlib 2.2. Use the WXAgg backend instead. See
Matplotlib usage FAQ for more info on backends.
  warnings.warn(message, mplDeprecation, stacklevel=1)
===========================
Width Function | quantiles
===========================
883 | 0.05
1756 | 0.15
2763 | 0.3
3218 | 0.4
3661 | 0.5
4218 | 0.6
4893 | 0.7
5926 | 0.85
6984 | 0.95


Done!

Kind regards,


On Thu, Feb 21, 2019 at 1:04 PM Veronica Andreo <veroandreo at gmail.com>
wrote:

> I get the same error that Juan gets, both with his commands and with those
> in the example in the manual page (and both in grass76 and trunk).
>
> [omitting the rest for brevity]
>
> r.width.funct map=dist2out image=/tmp/my_basin
>  100%
> Tot. cells 88407.0
> Tot. area 8840700.0
> Max distance 7714.591101
> Traceback (most recent call last):
>   File "/home/veroandreo/.grass7/addons/scripts/r.width.funct", line 135,
> in <module>
>     sys.exit(main())
>   File "/home/veroandreo/.grass7/addons/scripts/r.width.funct", line 84,
> in main
>     prc[0,0] , prc[0,1] = findint(kl,0.05) , 0.05
>   File "/home/veroandreo/.grass7/addons/scripts/r.width.funct", line 128,
> in findint
>     z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0],
> kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
> IndexError: invalid index to scalar variable.
>
> No idea...
>
> Maybe Madi can help us out here :)
>
> Vero
>
> El jue., 21 feb. 2019 a las 11:37, Helmut Kudrnovsky (<hellik at web.de>)
> escribió:
>
>> [keep the discussion always on the ML!]
>>
>> >Gesendet: Donnerstag, 21. Februar 2019 um 11:25 Uhr
>> >
>> >Von: "Juan Lopez" <cubarro at gmail.com>
>> >An:
>> >Betreff: Re: [GRASS-user] r.width.funct in correct version
>> >
>> >Dear Helmut.
>> >This is the output of g.region command:
>> >
>> >
>> >GRASS 7.6.0 (nc):/departamento/Test/nc_basic_spm > g.region -p
>> >projection: 99 (Lambert Conformal Conic)
>> >zone:       0
>> >datum:      nad83
>> >ellipsoid:  a=6378137 es=0.006694380022900787
>> >north:      228500
>> >south:      215000
>> >west:       630000
>> >east:       645000
>> >nsres:      10
>> >ewres:      10
>> >rows:       1350
>> >cols:       1500
>> >cells:      2025000
>>
>> and what is the exact r.width.funct command you used?
>>
>> see
>>
>> https://grass.osgeo.org/grass74/manuals/addons/r.width.funct.html
>>
>> for an example:
>>
>> ###########
>> g.region raster=elevation -p
>>
>> # Calculate flow direction
>> r.stream.extract elevation=elevation threshold=1000 \
>> direction=direction
>>
>> # Create outlet point
>> echo "637304.924954,218617.100523" | v.in.ascii input=- sep=',' out=outlet
>>
>> # Convert outlet point to raster
>> v.to.rast input=outlet type=point output=outlet use=cat
>>
>> # Calculate distance to outlet map
>> r.stream.distance -o stream_rast=outlet \
>> direction=direction distance=dist2out
>>
>> # Calculate width function
>> r.width.funct map=dist2out image=/tmp/my_basin
>> ###########
>>
>>
>> kind regards
>> Helmut
>>
>>
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>
>

-- 
Margherita Di Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190305/74398ca4/attachment.html>


More information about the grass-user mailing list