[Thread Prev][Thread Next][Index]

Re: [ferret_users]if else statement on negative values

Your syntax looks correct. For another example,
yes? use etopo20
yes? let upper  = if rose lt (-2000) then  (-2000) else rose
yes? stat upper
             IF ROSE LT (-2000) THEN  (-2000) ELSE ROSE
             LONGITUDE: 20E to 20.3E(380.3)
             LATITUDE: 90S to 90N
             Z:  N/A
             T:  N/A
             DATA SET: /home/users/tmap/ferret/linux/fer_dsets/data/etopo20.cdf
 Total # of data points: 583740 (1081*540*1*1)
 # flagged as bad  data: 0
 Minimum value: -2000
 Maximum value: 6228.8
 Mean    value: -746.69 (unweighted average)
 Standard deviation: 1588.1

How did you check the range of data in your variable u_ave_1?


On 9/12/2011 12:18 PM, jean li wrote:
Hi All:
I am trying to use the "if else" statement to set the lower limit of negative values.
However, the script below is not working. u_ave_1 still has the value below -20. It's supposed to work and had worked before. I don't quite understand why.     
let u_ave_1 = if u_ave[d=1] lt (-20) then (-20) else u_ave[d=1]
Thanks in advance for your help!


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement