enter image description here

I have a set of raster files that are essentially data sets of precipitation across a region. I have multiple raster files that are the outputs of different climate models. Each pixel in the raster file has 365 bands that represent the precipitation value for each day. I want to calculate the mean for each pixel for each band across the different raster files.

I tried converting the raster to point files and extracting multiple values to the point, extracting the data to excel and then averaging them for each raster. I was wondering if there is a more efficient way to do this.

  • the mean for each pixel for each band has no sense for me
    – aldo_tapia
    Commented Mar 22, 2018 at 17:30
  • So each raster (of which there are many) has 365 "bands" which represent the rainfall for that pixel for each day of the year. So you are looking to get the average rainfall for a pixel per model (raster)? Commented Mar 22, 2018 at 18:28
  • Some illustration, a table, a graphic would sure help to make the question clearer.
    – Techie_Gus
    Commented Mar 22, 2018 at 21:06
  • @Techie_Gus Ive updated the question witha figure.... Is the question clearer? Commented Mar 22, 2018 at 22:10
  • 2
    R: raster::calc(x, mean)
    – mdsumner
    Commented Jul 20, 2018 at 21:48

1 Answer 1


There are many raster calculators available. Depends, what software you are familiar with.

E.g. you can use GRASS GIS r.series module (the module is also accessible via QGIS toolbox).

As @mdsumner commented, you can also use R.

A programatic approach is to read data by Python Numpy and calculate desired statistics. Numpy methods are also implemented in the command line by gdal_calc.py.

If data is in NetCDF (typical format for climate/meteo time-series data), you can process with some of these tools (I can mention e.g. NCO)

In case of precipitation, maybe there is some purpose of averaging of daily data (compare 3 different datasources?). Maybe some other statistics (e.g. sum, max) could be considered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.