Can you post please some more information related to your query.<br>For example : region, resolution of raster dem, command used to generated the basin.<br>What do you get when you query the white area.<br><br><div class="gmail_quote">
On Thu, Apr 19, 2012 at 4:19 AM,  <span dir="ltr">&lt;<a href="mailto:grass-user-request@lists.osgeo.org">grass-user-request@lists.osgeo.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Send grass-user mailing list submissions to<br>
        <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:grass-user-request@lists.osgeo.org">grass-user-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:grass-user-owner@lists.osgeo.org">grass-user-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of grass-user digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. v.rast.stats for just a single statistic, in a python loop<br>
      (Ismael G?mez)<br>
   2. Re: v.rast.stats for just a single statistic, in a python<br>
      loop (Moritz Lennert)<br>
   3. Re: Simultaneous r.horizon processes (Hamish)<br>
   4. Re: v.rast.stats for just a single statistic, in a        python<br>
      loop (Ismael G?mez)<br>
   5. r.watershed: output basin map (Rich Shepard)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 18 Apr 2012 20:54:37 +0200<br>
From: Ismael G?mez &lt;<a href="mailto:gomez.ismael@gmail.com">gomez.ismael@gmail.com</a>&gt;<br>
Subject: [GRASS-user] v.rast.stats for just a single statistic, in a<br>
        python loop<br>
To: grass mailing list &lt;<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:CAN4%2BwUjD-9TMs_AD1Z6W5zi3TRvUsVPYfP60VUSYgeBNXLqVvQ@mail.gmail.com">CAN4+wUjD-9TMs_AD1Z6W5zi3TRvUsVPYfP60VUSYgeBNXLqVvQ@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hello,<br>
<br>
I would like to use the v.rast.stats inside a loop in a python script.<br>
The thing is I just need to get one of the nine columns it generates (sum).<br>
As it runs many times in the loop, it takes a lot of (unnecessary, for this<br>
script) time and also creates a huge table with too many (unnecessary, for<br>
this script) columns.<br>
I was wondering then if there was a way to specify the calculation for just<br>
that single statistic.<br>
<br>
Also, I wanted to ask you if there is a way to access the source code of a<br>
specific module (in this case, v.rast.stats) via web (without downloading<br>
the whole source code), just to have a quick look at it (and try to adapt<br>
it to my needs, eventually contribute to it if possible, ... I don&#39;t know,<br>
... just wondering what&#39;s the right way to do it ...).<br>
This might be a stupid question, but please take into account that i&#39;m<br>
still quite new in all this (fascinating) stuff.<br>
<br>
Thank you very much in advance.<br>
Regards<br>
<br>
--<br>
Ismael G.<br>
Ingeniero de Caminos (UPM). Ingénieur des Ponts et Chaussées (ENPC).<br>
PhD researcher @ Urban &amp; Land Planning Department @ ETSICCP UPM<br>
<a href="http://www.caminos.upm.es" target="_blank">www.caminos.upm.es</a> +34 91 336 67 83<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/8ab10514/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/8ab10514/attachment-0001.html</a><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 18 Apr 2012 21:25:51 +0200<br>
From: Moritz Lennert &lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;<br>
Subject: Re: [GRASS-user] v.rast.stats for just a single statistic, in<br>
        a python        loop<br>
To: Ismael G?mez &lt;<a href="mailto:gomez.ismael@gmail.com">gomez.ismael@gmail.com</a>&gt;<br>
Cc: grass mailing list &lt;<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4F8F153F.5080203@club.worldonline.be">4F8F153F.5080203@club.worldonline.be</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 18/04/12 20:54, Ismael Gómez wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I would like to use the v.rast.stats inside a loop in a python script.<br>
&gt; The thing is I just need to get one of the nine columns it generates (sum).<br>
&gt; As it runs many times in the loop, it takes a lot of (unnecessary, for<br>
&gt; this script) time and also creates a huge table with too many<br>
&gt; (unnecessary, for this script) columns.<br>
&gt; I was wondering then if there was a way to specify the calculation for<br>
&gt; just that single statistic.<br>
<br>
v.rast.stats is a script, so fairly easy to modify (see below for<br>
accessing it).<br>
<br>
<br>
&gt;<br>
&gt; Also, I wanted to ask you if there is a way to access the source code of<br>
&gt; a specific module (in this case, v.rast.stats) via web (without<br>
&gt; downloading the whole source code), just to have a quick look at it (and<br>
&gt; try to adapt it to my needs, eventually contribute to it if possible,<br>
<br>
<a href="http://trac.osgeo.org/grass/browser/grass" target="_blank">http://trac.osgeo.org/grass/browser/grass</a><br>
<br>
For the development version (aka grass7) go to trunk, for other version<br>
to branches.<br>
<br>
For v.rast.stats in the 6.4 release branch:<br>
<br>
<a href="http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats" target="_blank">http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats</a>.<br>

<br>
See &quot;Download in other formats&quot; at the bottom for downloading it.<br>
<br>
A quick and dirty guess would be that modifying<br>
<br>
line 247: BASECOLS=&quot;n min max range mean stddev variance cf_var sum&quot;<br>
<br>
and<br>
<br>
line 368    sed -e &#39;1d&#39; &quot;$STATSTMP&quot; | awk -F &quot;|&quot; &#39;{printf &quot;\nUPDATE<br>
&#39;${TABLE}&#39; SET &#39;${col1}&#39; = %i , &#39;${col2}&#39; = %.2f , &#39;${col3}&#39; = %.2f ,<br>
&#39;${col4}&#39; = %.2f , &#39;${col5}&#39; = %.2f , &#39;${col6}&#39; = %.2f , &#39;${col7}&#39; =<br>
%.2f , &#39;${col8}&#39; = %.2f , &#39;${col9}&#39; = %.2f WHERE &#39;${KEYCOL}&#39; = %i;&quot;,<br>
$2,$3,$4,$5,$6,$7,$8,$9,$10,$1}&#39; &gt; &quot;$SQLTMP&quot;<br>
<br>
could actually be enough.<br>
<br>
Moritz<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 18 Apr 2012 12:31:34 -0700 (PDT)<br>
From: Hamish &lt;<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>&gt;<br>
Subject: Re: [GRASS-user] Simultaneous r.horizon processes<br>
To: Collin Bode &lt;<a href="mailto:collin@berkeley.edu">collin@berkeley.edu</a>&gt;, Daniel Lee<br>
        &lt;<a href="mailto:lee@isi-solutions.org">lee@isi-solutions.org</a>&gt;<br>
Cc: GRASS user list &lt;<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:1334777494.42576.YahooMailClassic@web110008.mail.gq1.yahoo.com">1334777494.42576.YahooMailClassic@web110008.mail.gq1.yahoo.com</a>&gt;<br>
Content-Type: text/plain; charset=iso-8859-1<br>
<br>
Daniel wrote:<br>
&gt; What do you mean, r.sun can do multithreading? I&#39;ve heard that<br>
&gt; r.sun uses multithreading in GRASS 7, but is that implemented<br>
&gt; in GRASS 6? Or are you talking about &quot;poor man&#39;s<br>
&gt; multithreading,&quot; like on the GRASS wiki?<br>
<br>
there is OpenCL GPU accel. support, but it has not yet been<br>
merged into grass 7. (mea culpa)<br>
<br>
for r.sun being run 365 (or whatever) times in a row the &quot;poor<br>
man&#39;s&quot; method is fine, in fact the r3.in.xyz script in addons<br>
is perhaps the most efficient multi-CPUing in grass to date.<br>
(to my surprise)<br>
<br>
<br>
I&#39;ve just read through the r.horizon code in devbr6 and I don&#39;t<br>
see anything which makes the module unable to be run multiple<br>
times in the same mapset. (no external region setting, no<br>
generically named temp files, no gratuitous use of grass library<br>
global variables)   ... are you running under NFS or similar as<br>
addressed by Markus&#39;s script? aka maybe the trouble is rooted<br>
elsewhere?<br>
<br>
&gt; I did a little debugging today and think it&#39;s due to the large<br>
&gt; size of my study area (~36 km², 0.5m resolution).<br>
<br>
72000x72000, how much ram does r.horizon use?<br>
maybe processes are being killed as you run out of RAM.<br>
in that case set max num of parallel jobs so that it fits<br>
into memory without going into swap space instead of num of CPUs.<br>
and error handling in the script (test for &#39;$? -ne 0&#39;) could<br>
help try failing runs again.<br>
<br>
&gt; If I spatially partition the area and then stitch everything<br>
&gt; back together, I hope it works - tests on smaller regions have<br>
&gt; worked correctly thus far but I&#39;ll need to wait a while to see<br>
&gt; the real results.<br>
<br>
for r.horizon the mountains in the distance can matter (that&#39;s<br>
the whole point) so I&#39;d be careful with cutting up the region.<br>
temporarily lowering the region resolution during r.horizon<br>
may be less-bad of a compromise.<br>
<br>
<br>
FWIW I&#39;ve tentatively given up on using r.horizon, see the &quot;r.sun<br>
commissioning trials&quot; trac ticket and wiki page. since sun<br>
placement changes each day, and for sub degree placement of the<br>
sun you need so many horizon maps as to make the loading of them<br>
all more expensive than just re-calculating it on-the-fly but<br>
with the exact placement. (I generally try for slow exactness<br>
instead of fast processing time though, YMMV)<br>
but maybe I don&#39;t correctly understand what r.horizon is doing..<br>
<br>
<br>
Hamish<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 18 Apr 2012 23:44:12 +0200<br>
From: Ismael G?mez &lt;<a href="mailto:gomez.ismael@gmail.com">gomez.ismael@gmail.com</a>&gt;<br>
Subject: Re: [GRASS-user] v.rast.stats for just a single statistic, in<br>
        a       python loop<br>
To: Moritz Lennert &lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;<br>
Cc: grass mailing list &lt;<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:CAN4%2BwUjvUULZoQsPp0_VtjU79ACi2DMFWmiFo4Z2Y2dH-XFFQg@mail.gmail.com">CAN4+wUjvUULZoQsPp0_VtjU79ACi2DMFWmiFo4Z2Y2dH-XFFQg@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Thanks a million, Moritz.<br>
Yours,<br>
Ismael<br>
<br>
2012/4/18 Moritz Lennert &lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;<br>
<br>
&gt; On 18/04/12 20:54, Ismael Gómez wrote:<br>
&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I would like to use the v.rast.stats inside a loop in a python script.<br>
&gt;&gt; The thing is I just need to get one of the nine columns it generates<br>
&gt;&gt; (sum).<br>
&gt;&gt; As it runs many times in the loop, it takes a lot of (unnecessary, for<br>
&gt;&gt; this script) time and also creates a huge table with too many<br>
&gt;&gt; (unnecessary, for this script) columns.<br>
&gt;&gt; I was wondering then if there was a way to specify the calculation for<br>
&gt;&gt; just that single statistic.<br>
&gt;&gt;<br>
&gt;<br>
&gt; v.rast.stats is a script, so fairly easy to modify (see below for<br>
&gt; accessing it).<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; Also, I wanted to ask you if there is a way to access the source code of<br>
&gt;&gt; a specific module (in this case, v.rast.stats) via web (without<br>
&gt;&gt; downloading the whole source code), just to have a quick look at it (and<br>
&gt;&gt; try to adapt it to my needs, eventually contribute to it if possible,<br>
&gt;&gt;<br>
&gt;<br>
&gt; <a href="http://trac.osgeo.org/grass/**browser/grass" target="_blank">http://trac.osgeo.org/grass/**browser/grass</a>&lt;<a href="http://trac.osgeo.org/grass/browser/grass" target="_blank">http://trac.osgeo.org/grass/browser/grass</a>&gt;<br>

&gt;<br>
&gt; For the development version (aka grass7) go to trunk, for other version to<br>
&gt; branches.<br>
&gt;<br>
&gt; For v.rast.stats in the 6.4 release branch:<br>
&gt;<br>
&gt; <a href="http://trac.osgeo.org/grass/**browser/grass/branches/**" target="_blank">http://trac.osgeo.org/grass/**browser/grass/branches/**</a><br>
&gt; releasebranch_6_4/scripts/v.**rast.stats/v.rast.stats&lt;<a href="http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats" target="_blank">http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats</a>&gt;<br>

&gt; .<br>
&gt;<br>
&gt; See &quot;Download in other formats&quot; at the bottom for downloading it.<br>
&gt;<br>
&gt; A quick and dirty guess would be that modifying<br>
&gt;<br>
&gt; line 247: BASECOLS=&quot;n min max range mean stddev variance cf_var sum&quot;<br>
&gt;<br>
&gt; and<br>
&gt;<br>
&gt; line 368    sed -e &#39;1d&#39; &quot;$STATSTMP&quot; | awk -F &quot;|&quot; &#39;{printf &quot;\nUPDATE<br>
&gt; &#39;${TABLE}&#39; SET &#39;${col1}&#39; = %i , &#39;${col2}&#39; = %.2f , &#39;${col3}&#39; = %.2f ,<br>
&gt; &#39;${col4}&#39; = %.2f , &#39;${col5}&#39; = %.2f , &#39;${col6}&#39; = %.2f , &#39;${col7}&#39; = %.2f ,<br>
&gt; &#39;${col8}&#39; = %.2f , &#39;${col9}&#39; = %.2f WHERE &#39;${KEYCOL}&#39; = %i;&quot;,<br>
&gt; $2,$3,$4,$5,$6,$7,$8,$9,$10,$**1}&#39; &gt; &quot;$SQLTMP&quot;<br>
&gt;<br>
&gt; could actually be enough.<br>
&gt;<br>
&gt; Moritz<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Ismael G.<br>
Ingeniero de Caminos (UPM). Ingénieur des Ponts et Chaussées (ENPC).<br>
PhD researcher @ Urban &amp; Land Planning Department @ ETSICCP UPM<br>
<a href="http://www.caminos.upm.es" target="_blank">www.caminos.upm.es</a> +34 91 336 67 83<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/9ddc3f11/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/9ddc3f11/attachment-0001.html</a><br>

<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Wed, 18 Apr 2012 15:48:34 -0700 (PDT)<br>
From: Rich Shepard &lt;<a href="mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com</a>&gt;<br>
Subject: [GRASS-user] r.watershed: output basin map<br>
To: <a href="mailto:grass-users@lists.osgeo.org">grass-users@lists.osgeo.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:alpine.LNX.2.00.1204181543020.24382@salmo.appl-ecosys.com">alpine.LNX.2.00.1204181543020.24382@salmo.appl-ecosys.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
   The attached pdf shows the basin map output by r.watershed based on a 10m<br>
DEM and a threshold of 150000. The NHD level 6 subbasins are outlined in<br>
black and the 1:24K NHD streams are in blue.<br>
<br>
   The small white areas at the bottom left and center right appear to be<br>
external to defined sub-basins. But I don&#39;t know how to interpret the larger<br>
white areas with streams in them (center and top). The top margin is an<br>
international boundary so I can understand not being able to completely<br>
define sub-basins across that boundary since the DEM doesn&#39;t reach that far<br>
north, but it&#39;s not consistently white.<br>
<br>
   Please help me interpret the white areas with vector streams.<br>
<br>
TIA,<br>
<br>
Rich<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: ebeco-basins.pdf<br>
Type: application/pdf<br>
Size: 32471 bytes<br>
Desc:<br>
Url : <a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/beb8bc6c/ebeco-basins.pdf" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20120418/beb8bc6c/ebeco-basins.pdf</a><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br>
<br>
End of grass-user Digest, Vol 72, Issue 37<br>
******************************************<br>
</blockquote></div><br>