# Calculating quantile values over a stack of images with grass gis. Help needed on r.series

I need to calculate the values for the 25%, 50%, 75% and 90% quantile over a series of rasters (time series of ndvi values from landsat). I am exploring the r.series command in Grass GIS, but the documentation is very poor and it doesn't seem to fit my needs.

I would need to calculate out of the overall distribution of values in the 12 monthly ndvi images the indicated quantile. I just need the values, not a map.

Any idea on the matter? Anyone can actually explain me what method=quantile actually does in r.series on grass gis?

## 1 Answer

You were right, the r.series manual page was a bit lousy. I have hopefully improved it now. Comments certainly welcome.

Concerning quantiles, if you want a single, i.e. a global map value, then check

Example: Calculation of multiple elevation quantiles, results are printed and not stored as a new map:

``````g.region rast=elevation -p
r.quantile input=elevation percentiles=0.1,1,10,25,50,75,90,99,99.9
...
Computing quantiles
0:0.100000:59.870384
1:1.000000:68.065155
2:10.000000:84.523346
3:25.000000:94.789986
4:50.000000:108.879921
5:75.000000:126.791985
6:90.000000:138.660385
7:99.000000:149.824585
8:99.900000:153.375854
``````

For an overview of options, see also http://grass.osgeo.org/grass70/manuals/topic_statistics.html

• H MarkusN,thanks for your answer and above all thanks for improving grass gis for all of us. Sorry but, even with the new manual I still don't understand how option=quantile works. I understand that it will consider in the calculation only the pixel values that fall in the specified quantile, but how does r.series calculate the output pixel value? It is selfevident for option=average or max or stddev, but I just don't understand it for quantile. Moreover, as I need to have the distribution over a set of images(not one by one) I don't think r.univar nor r.quantile work for me. Thanks again – ciskoh Oct 10 '14 at 7:34
• Solution found! R.univar, despite the name, can actually calculate statistics on multiple raster at ones. My bad for not checking thoroughly. Thanks markusN for answering me.. – ciskoh Oct 10 '14 at 17:42
• As you found out, r.univar can accept multiple input maps. – markusN Oct 12 '14 at 22:40