How to get the average data of acummulated precipitation

Viewed 34

I'm really new to this CDO thing and I feel awkward.

I have been working with netcdf files that have daily precipitation data and I would like to perform these calculations with CDO

  • First calculate the moving sum of precipitation using a 5-day window.

-Then calculate the annual maximum of the sliding sum for each year.

-And finally, calculate the 20-year average of those values

2 Answers

Assuming everything is in a single file, the following approach, where all 3 calcs are chained, should work:

cdo -timmean -yearmax -runsum,5 infile outfile

Logged on to find the question has been completely changed, so I deleted my original answer.

Robert Wilson's answer now addresses your new question perfectly, I just wanted to add that as an alternative to using the running mean, you might also think to just do simple pentad averages that are commonly employed in meteorology. In that case you would want to do

cdo timselmean,5 in.nc out.nc 

this gives you pentad averages. Then you can get the max pentad value and take the twenty year average in the same way as Robert shows, thus piping the three commands you get

cdo -timmean -yearmax -timselmean,5 in.nc out.nc 
Related