Hamish wrote: > > Is there any way to take a set of rasters (the output from many > > days of r.sun, for example) and average all their values > > together? > > sure, use r.series. Rather than doing the average directly (which > you can do), a common way is to create a sum map and then manually > use r.mapcalc to divide by the number of days to get the avg. I > guess running r.series twice would be just as good..
Note that by default, r.series calculates the aggregate over the non-null values, so the average of [1,null,2] is (1+2)/2 = 1.5, not (1+2)/3 = 1. Dividing the result of "r.series method=sum" by a fixed denominator will result in nulls effectively being treated as zeros (i.e. they don't affect the sum but they're accounted for by the denominator). If you want to separate the steps, divide the result of "r.series method=sum" with the result of "r.series method=count"; the latter counts the number of non-null input cells. -- Glynn Clements <[email protected]> _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
