[GRASS-user] Calculate average of 3 highest values for a set of raster maps
José Miguel Barrios
jmbarriosg at gmail.com
Thu Mar 14 23:33:36 PDT 2013
Hi Milton,
A possible approach could be, for example, to do the following with each
map:
r.stats -1 input=map1 output=cellvaluesmap1
It will create a file containing the cell values for each map. Then you
can read this file into R and average the three highest values. Something
like:
values.map1<-read.table("cellvaluesmap1")
threehighest<-values.map1$V1[order(values.map1,decreasing=FALSE)][1:3]
mean3highest<-mean(threehighest)
Hope it helps. Success
Miguel
2013/3/15 Milton Cezar Ribeiro <miltinho.astronauta at gmail.com>
> I have a set of 7 raster maps.
> I am able to calculate several stats with these mapas using r.series.
> Now I need to calculate the mean of the tree highest values of my 7 maps.
> Any idea of how can I do that?
>
> cheers
> --
> Miltinho - mcr at rc.unesp.br
> Laboratório de Ecologia Espacial e Conservação - LEEC
> Depto de Ecologia - UNESP - Rio Claro
> Av. 24A, 1515- Bela Vista
> 13506-900 Rio Claro, SP, Brasil
>
> Fone: +55 19 3526-9647 (office) 19 3526-9680 (lab)
> Cel: 19 9853-3220 / 19 9853-5430
>
> Depto Ecologia http://www.rc.unesp.br/ib/ecologia/
>
> PG ECO & BIODIV
> http://www.rc.unesp.br/ib/ecologia/posbiodiversidade/index.php
>
> CV
> http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true
>
> Google citations http://scholar.google.com/citations?user=OWX_2eAAAAAJ
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130315/c7b7f6bb/attachment.html>
More information about the grass-user
mailing list