Reputation: 35
I have been working with precipitation data from the IMERG satellite which is every 30 minutes.
I have been building the precipitation between 12 UTC one day and 12 UTC the other day.
cdo shifttime,-12hours -daysum -shifttime,12hours in.nc4 out.nc4
But I see that the "daysum" command adds 2 times each value, check this by downloading a daily data and I see that the values are exactly double.
Does anyone know how to fix this since it seems that the daysum command is not working for me.
Thank you very much!
Upvotes: 1
Views: 783
Reputation: 8087
I think the issue is that the units of the 30 minute data are mm/hour and so if you sum the data you will not get mm/day, since the data is every thirty minutes, but 2*mm/day. Instead the file you downloaded to check has units of mm/day (well done, by the way, for independently checking your answer). This is why self-describing files having units is so important ;-)
To get units of mm/day you simply need to divide by 2:
cdo -divc,2 -shifttime,-12hours -daysum -shifttime,12hours in.nc4 out.nc4
Easy error to make by the way, I've done it myself in the past, especially if you are used to dealing with fluxes from weather forecast output which are usually always accumulated over the output step time (i.e. that would be 30 minutes in this case).
This is why it is usually safer and less confusing to use mean instead of sum for two reasons.
cdo mulc
and update the metadata but it is easier to do this without making mistakes.mean
or avg
.Upvotes: 1