Operator to compare constant field with many timestep field
Added by Anonymous over 14 years ago
Greeting All,
I have t2max-2005.nc file, which is daily maximum temperature for the year 2005 (365 time steps).
and then I have averaged file t2max-2005.nc to compute the average value of tmax over whole year. Let say, I got t2max-average-2005.nc ( only 1 time step ).
I would like to count number of days in t2max-2005.nc greater than t2max-averge-2005.nc
Which cdo operator can I do that?
Any advantage will be highly appreciate,
-Jo
Replies (3)
RE: Operator to compare constant field with many timestep field - Added by Ralf Mueller over 14 years ago
Possible Solution steps:
- subtract the average values from the original data with
cdo sub t2max-2005.nc t2max-average-2005.n t2max-diffToAverage.nc
- mask the positive values, i.e. set every positive value to 1, others to 0:
cdo gtc,0 t2max-diffToAverage.nc t2max-diffToAverage-Mask.nc
- sum up the timeries locally:
cdo timsum t2max-diffToAverage-Mask.nc numberOfDaysWithT2maxAboveTheAverage.nc
It is possible to do without the temporary files:
cdo timsum -gtc,0 -sub t2max-2005.nc t2max-average-2005.nc numberOfDaysWithT2maxAboveTheAverage.nc
regards
ralf
RE: Operator to compare constant field with many timestep field - Added by Ralf Mueller over 14 years ago
You could also avoid the average file:
cdo timsum -gtc,0 -sub t2max-2005.nc -timavg t2max-2005.nc numberOfDaysWithT2maxAboveTheAverage.nc
Depending on your number encoding, this could improve the accuracy of your results.
RE: Operator to compare constant field with many timestep field - Added by Anonymous over 14 years ago
Its worked. Thank you so much for your quickly reply.