Project

General

Profile

CDO mermin: obtain minimum with its corresponding latitude

Added by Maria Rita Mancino about 1 year ago

Hello there,

I'm interested in the latitude corresponding to minimum value of a selected field.
With mermin, for every longitude I obtain the minimum over all latitudes (and this is exactly what I want), but after this operation latitudes are all 0. Instead I need the information about the original latitude.
As final result I want an ASCII table of minimum values with their original corresponding coordinates (lon,lat).
What should I do?

Thanks


Replies (3)

RE: CDO mermin: obtain minimum with its corresponding latitude - Added by Karin Meier-Fleischer about 1 year ago

Hi Maria,

edit: sorry, now I know what you mean, you want to see at which latitude the mermin is. IMO this is not possible.

what do you expect to get as latitude value using the -mermin operator? Docu: For every longitude the minimum over all latitudes is computed. Assume the latitude range is -90 to 90 than the mean value of all latitudes is 0.

Use the operator -outputtab to write the result to an ASCII file, e.g.

cdo -outputtab,lon,lat,value -mermin infile.nc > outfile.txt

RE: CDO mermin: obtain minimum with its corresponding latitude - Added by Maria Rita Mancino about 1 year ago

I thought it was possibile to see at which latitude the mermin is...
Anyway thank you for your reply!

RE: CDO mermin: obtain minimum with its corresponding latitude - Added by Estanislao Gavilan about 1 year ago

Hi Maria,

you could write a script with a loop that selects each longitude. Then you can use fldmin to locate the min of your fields along the latitude. Then you just need to output as Karin said. Maybe something like this

for n in {0..359}
do
fileout='total_ascii_'$n'.txt'
cdo -outputtab,lon,lat,value -fldmin,maskvar -expr,'maskvar = (lon(var_1) != %n ) ? (var_1*1e+22) : var_1' -selvar=var_1 infile.nc %fileout

done

cat total_ascii_* > merge_ascii.txt

Kind regards,

Estanislao

PS: I am not sure if this can work, you might need to do some changes.

    (1-3/3)