[GRASS-stats] r.mapcalc, median and NULL

Joel Pitt joel.pitt at gmail.com
Thu Feb 12 13:40:07 EST 2009


I think what you want is r.series

On Fri, Feb 13, 2009 at 6:58 AM, Agustin Lobo <Agustin.Lobo at ija.csic.es> wrote:
> Hi!
> The grass doc is very clear on the behavior of r.mpacalc regarding NULL:
> "NULL-values in function arguments should result in NULL"
>
> I have to calculate the median of a set of 12 monthly layers, i.e.
> mean(l1,l2,l3,...l12)
>
> the problem is that some layers have some NULL values. I can
> replace NULL by, for example, 0, but this will be having a large effect
> in the value of the mean. Is not there any way of setting something
> like the na.rm=T of R?
>
> Alternatively, could I calculate (in GRASS) a raster of the number of
> months with NULL value present
> for each i, j position? In that way I could replace NULL by 0 but then add up
> the layers and divide by a raster that would be 12 in most cells, 11 in those
> having 1 NULL, 10 in those having 2 NULL etc
>
> Not sure if I explain myself clearly. Would be easily done in R, but
> the raster layers are large. Perhaps a problem for the R raster
> package?
>
> Agus
>
>
> --
> Dr. Agustin Lobo
> Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
> Lluis Sole Sabaris s/n
> 08028 Barcelona
> Spain
> Tel. 34 934095410
> Fax. 34 934110012
> e-mail Agustin.Lobo at ija.csic.es
> http://www.ija.csic.es/gt/obster
> _______________________________________________
> grass-stats mailing list
> grass-stats at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-stats
>


More information about the grass-stats mailing list