The r.series function applied to a range of values

One of the fundamental functions in GRASS GIS is the r.series function. It makes each output cell value a function of the values assigned to the corresponding cells in the input raster map layers. I use it very often in my analyses, but I only recently ‘discovered’ this option to ignore values outside an user-defined range.

From the manual page; if the range= option is given, any values which fall outside that range will be treated as if they were NULL. For example, if you have daily temperature data layers, you can use this options to count the number of days above a certain temperature:

# Use g.list to get all layer names
# and write it to a text file
g.list type=raster pattern="temp_2003_*" \
       output=mapnames.txt

# Now use the r.series to count from all 
# these layers the number of days with 
# temperatures between 5 and 10 degrees.
r.series file=mapnames.txt output=outmap \
range=5.0,10.0 method=count

Always nice to find that that functionality you are looking for is already implemented🙂. And if you are using GRASS functions through the QGIS toolbox, look under ‘advanced parameters’ in the r.series window.

One thought on “The r.series function applied to a range of values

  1. Pingback: The r.series function applied to a range of values in GRASS GIS | GeoNe.ws

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s