Project

General

Profile

cdo function: when is maximum/minimum reached ?

Added by Ivan Guettler about 11 years ago

Greetings everyone!

I wonder, is there a simple way using cdo to compute the exact date when maximum or minimum is reached? When using function such as timmax, the LAST timestep from the infile is saved.

Any suggestion is welcome!

Cheers,
Ivan


Replies (4)

RE: cdo function: when is maximum/minimum reached ? - Added by Jaison-Thomas Ambadan about 11 years ago

Hi,

try:

cdo -outputtab,date,value -timmax ifile

Cheers,
J

RE: cdo function: when is maximum/minimum reached ? - Added by Jaison-Thomas Ambadan about 11 years ago

hi again,

most likely the above doensn't work - sorry :(

may be you could try "grep" the "timmax" on the "-outputtab,date,value", on the original file.. like:

cdo -outputtab,date,value ifile | grep "$(cdo -outputf,%6.4f,1 -timmax ifile)" 

hope this helps!

Cheers,
J

RE: cdo function: when is maximum/minimum reached ? - Added by Ivan Guettler about 11 years ago

Hi,

Thnx for the quick reply. If I follow Your suggestion I get again the last timestep of the input file. Let me give you a short example of what I'm interested in:

Let say we have a 100 element vector, and the maximum value 22 is in the element 79. I'm interested in both maximum value (i.e. 22) AND the location (i.e. 79) of the maximum value. While cdo has no problem in finding the maximum value (i.e. 22) it usually sets the location of this element (location can be e.g. time) to the value 100.

Hope I've described my question better now.

Cheers,
Ivan

Jaison-Thomas Ambadan wrote:

Hi,

try:

[...]

Cheers,
J

RE: cdo function: when is maximum/minimum reached ? - Added by Ivan Guettler about 11 years ago

Hi again,

Some thing like this is fine when working with vector. It would be nice to have a function that directly saves the 2D field of the dates in the netcdf file :)

Cheers,
Ivan

Jaison-Thomas Ambadan wrote:

hi again,

most likely the above doensn't work - sorry :(

may be you could try "grep" the "timmax" on the "-outputtab,date,value", on the original file.. like:

[...]

hope this helps!

Cheers,
J

    (1-4/4)