Project

General

Profile

Computing list of timesteps with certain property

Added by Ralf Mueller almost 14 years ago

(original from Sebastian Grätsch)

Hi,
I'm looking for a cdo command to "grep out" timesteps with different propertyes like

  • Temp > 15° or > 25°
  • RR > 20mm or > 25mm

form a netcdf file.


Replies (1)

RE: Computing list of timesteps with certain property - Added by Ralf Mueller almost 14 years ago

Temp and RR can be processed in the same way, so I will concentrate on Temp.

Let's say, in.nc contians of daily values. Then you can mask out the points with a certain property with the comparison operators

cdo -gtc,15.0 in.nc out.nc

If you temperature is saved in Kelvin, just substract 273.15 on the command line with
cdo -gtc,-15.0 -subc,273.15 in.nc out.nc

Remember the use if the info-operators to check the output without creating an output file:
cdo infov -gtc,15.0 -subc,273.15

To count the total number days with that property, use the timsum opertor:
cdo infov -timsum -gtc,15.0 -subc,273.15

If you want to unset every value, which does not have the above property, use the above commands as a mask for the input file. Masks can be applied with the ifthen operator for example:

cdo ifthen -gtc,10.0 -subc,273.15 in.nc in.nc out.nc

    (1-1/1)