what about computing the first largest value, making your categorical map, and using it as a mask ?<br><br>if you mask all cell containing the first largest value, then the second largest value will become the first largest value of the masked raster serie ...<br>
<br><br>my 2 ct<br><br>Sylvain<br><br><br><br><div class="gmail_quote">2011/12/10 Marcello Gorini <span dir="ltr"><<a href="mailto:gorini@gmail.com">gorini@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br>Marcello:<div class="gmail_quote"><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
> My problem is that I also need to find the *second largest* value and the<br>
> corresponding raster number which contains the second largest value.<br>
><br>
> I am doing that by iterating over all classes through a shell script, but it<br>
> obviously takes much more time than using a simple r.series command.<br>
><br>
> Can anyone share any idea on how to accomplish that using r.series or<br>
> something similar?<br>
<br></div></blockquote></div><div><br>Glynn:<br> <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
</div>There isn't an efficient way to do this using existing tools. If you<br>
need the efficiency, I suggest adding a "second largest" aggregate to<br>
lib/stats (based upon c_max.c and c_maxx.c), and updating r.series to<br>
use it.<br>
<span><font color="#888888"><br></font></span></blockquote><span><font color="#888888"></font></span><br></div>Thanks for pointing me the way. I think it is a little beyond my skills, but I might give it a try.<br>
<br>Cheers,<br>Marcello.<br></div>
<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></blockquote></div><br>