<div dir="ltr">My suggestion does just that, per pixel calculations. And as it is just simple GRASS functions, you should have no problem running it (perhaps a bit of patients depending on your computer). <br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Mar 15, 2013 at 12:13 PM, Milton Cezar Ribeiro <span dir="ltr"><<a href="mailto:miltinho.astronauta@gmail.com" target="_blank">miltinho.astronauta@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
Thanks for all replies. I will check it out thoughout the weekend.<br>
Just clarifying something, I need to do the estimations focusing on<br>
each pixels, and not for the full map (I was not that clear before).<br>
<br>
Also as my raster maps are very large (~50,000x60,000 pixels) maybe R<br>
(at least on w7) maybe will not handle the seven rasters.<br>
<br>
Best wishes<br>
<br>
miltinho<br>
<br>
2013/3/15, Paulo van Breugel <<a href="mailto:p.vanbreugel@gmail.com">p.vanbreugel@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Sorry, some typo's (but the given code should be ok): set all values <<br>
> 4/7 quantile to null(), not 0, and you want to calculate the average,<br>
> not the sum<br>
><br>
> On Fri 15 Mar 2013 10:05:51 AM CET, Paulo van Breugel wrote:<br>
>> Hi Miltinho<br>
>><br>
>> I assume you want the mean of the three highest values for each raster<br>
>> cell? If so, you can do this using another step with r.series<br>
>><br>
>> 1) If your 7 maps are a1 .. a7:<br>
>><br>
>> mapcalc "a1 = 1"; r.mapcalc "a2 = 2"; r.mapcalc "a3 = 3"; r.mapcalc<br>
>> "a4 = 4"; r.mapcalc "a5 = 5"; r.mapcalc "a6 = 6"; r.mapcalc "a7 = 7"<br>
>><br>
>> 2) calculate the 4/7 quantile. Actually, it should be a little bit<br>
>> smaller to make sure you include your 3rd largest layer. In this<br>
>> example below, 0.57 as approximation is fine<br>
>><br>
>> r.series --overwrite input=a1,a2,a3,a4,a5,a6,a7 quantile=0.57<br>
>> output=res1 method=quantile<br>
>><br>
>> 2) Next, for all 7 layers, set all values < 4/7 quantile to 0<br>
>><br>
>> r.mapcalc "b1 = if(a1>res1,a1,null())"<br>
>> r.mapcalc "b2 = if(a2>res1,a2,null())"<br>
>> r.mapcalc "b3 = if(a3>res1,a3,null())"<br>
>> r.mapcalc "b4 = if(a4>res1,a4,null())"<br>
>> r.mapcalc "b5 = if(a5>res1,a5,null())"<br>
>> r.mapcalc "b6 = if(a6>res1,a6,null())"<br>
>> r.mapcalc "b7 = if(a7>res1,a7,null())"<br>
>><br>
>> 3) Now, calculate the sum of the 7 new layers<br>
>><br>
>> r.series input=b1,b2,b3,b4,b5,b6,b7 method=average output=res2<br>
>> --overwrite<br>
>><br>
>> Your output res2 should have a value 6 for all raster cells.<br>
>><br>
>> Cheers,<br>
>><br>
>> Paulo<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Fri 15 Mar 2013 03:57:35 AM CET, Milton Cezar Ribeiro wrote:<br>
>>> I have a set of 7 raster maps.<br>
>>> I am able to calculate several stats with these mapas using r.series.<br>
>>> Now I need to calculate the mean of the tree highest values of my 7<br>
>>> maps.<br>
>>> Any idea of how can I do that?<br>
>>><br>
>>> cheers<br>
><br>
<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">--<br>
Miltinho - <a href="mailto:mcr@rc.unesp.br">mcr@rc.unesp.br</a><br>
Laboratório de Ecologia Espacial e Conservação - LEEC<br>
Depto de Ecologia - UNESP - Rio Claro<br>
Av. 24A, 1515- Bela Vista<br>
13506-900 Rio Claro, SP, Brasil<br>
<br>
Fone: <a href="tel:%2B55%2019%203526-9647" value="+551935269647">+55 19 3526-9647</a> (office) 19 3526-9680 (lab)<br>
Cel: 19 9853-3220 / 19 9853-5430<br>
<br>
Depto Ecologia <a href="http://www.rc.unesp.br/ib/ecologia/" target="_blank">http://www.rc.unesp.br/ib/ecologia/</a><br>
<br>
PG ECO & BIODIV <a href="http://www.rc.unesp.br/ib/ecologia/posbiodiversidade/index.php" target="_blank">http://www.rc.unesp.br/ib/ecologia/posbiodiversidade/index.php</a><br>
<br>
CV <a href="http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true" target="_blank">http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true</a><br>
<br>
Google citations <a href="http://scholar.google.com/citations?user=OWX_2eAAAAAJ" target="_blank">http://scholar.google.com/citations?user=OWX_2eAAAAAJ</a><br>
</div></div></blockquote></div><br></div>