Select positive values only
Added by Almami Johnson about 11 years ago
Dear All
I'm just wondering how to select positive values only from an input file and save them in an output file while putting all negative values to 0.
Thanks.
Replies (2)
RE: Select positive values only - Added by Uwe Schulzweida about 11 years ago
Try the CDO operator setrtoc:
setrtoc Set range to constant / c if i(t,x) GE rmin AND i(t,x) LE rmax o(t,x) = \ i(t,x) if i(t,x) LT rmin AND i(t,x) GT rmaxSyntax:
setrtoc,rmin,rmax,c ifile ofileExample:
cdo setrtoc,-1.e99,0,0 ifile ofile
RE: Select positive values only - Added by Almami Johnson about 11 years ago
It works perfectly. Many thanks.