Averaging on the specific time of the day
Added by ep gupal over 3 years ago
I have a 3 hourly data, ranging from 2019-01-01 03:00:00 to 2020-01-01 00:00:00, and when I do a daily average with the following command
cdo daymean infile.nc outfile.nc
I get 366 days instead of 356 days, which is obviously wrong. I think this is happening because the time is extending out to 2020 which is being counted for the last time step. So, I was thinking that if I perform averaging for a specific time, say at 09:00:00, I could solve the problem. Is there a way to perform daily average in this way?
Thanks.
Replies (2)
RE: Averaging on the specific time of the day - Added by Karin Meier-Fleischer over 3 years ago
Hi Ep,
what actually happened is that you get 365 days for 2019 and 1 day for 2020. To prevent this you can select the year 2019 beforehand.
cdo -daymean -selyear,2019 infile outfile
-Karin
RE: Averaging on the specific time of the day - Added by François Roberge over 3 years ago
You might interested in the solution here (Calculating daily average from 6 hourly data) :
https://code.mpimet.mpg.de/boards/2/topics/3671
cdo shifttime,1sec -daymean -shifttime,-1sec infile outfile