[Thread Prev][Thread Next][Index]
Re: Question about Making NaN..
Hi Jordan & Jammal Tanclei,
The two variable method will make all values .GE. 0
missing values ( I think the expression "missing_value" wiil be more appropriate
than "NAN" in the context of Ferret & netCDF).
yes? let dat = {30,29,28.5,31,0,26,39,0,-31}
yes? let var1 = if dat lt 0.0 then dat
yes? let var = if var1 gt 0.0 then dat else var1
yes? list var
VARIABLE : IF VAR1 GT 0.0 THEN DAT ELSE VAR1
SUBSET : 9 points (X)
1 / 1: ....
2 / 2: ....
3 / 3: ....
4 / 4: ....
5 / 5: ....
6 / 6: ....
7 / 7: ....
8 / 8: ....
9 / 9: -31.00
yes?
If you want to convert only "0.0" to missing value then ;
method.1 : set the "bad" (ie. missing ) value for the variable to 0.0
(This will not alter the "effect of" a previous missing_value, if
exists)
yes? let dat = {30,29,28.5,31,0,26,39,0,-31}
yes? set var/bad=0.0 dat
yes? list dat
VARIABLE : {30,29,28.5,31,0,26,39,0,-31}
SUBSET : 9 points (X)
1 / 1: 30.00
2 / 2: 29.00
3 / 3: 28.50
4 / 4: 31.00
5 / 5: ....
6 / 6: 26.00
7 / 7: 39.00
8 / 8: ....
9 / 9: -31.00
yes?
method.2 : Define a new variable so that "0.0" will be missing value
yes? let dat = {30,29,28.5,31,0,26,39,0,-31}
yes? let dat1 = IF dat LT 0 OR dat GT 0 THEN dat
yes? list dat1
VARIABLE : IF DAT LT 0 OR DAT GT 0 THEN DAT
SUBSET : 9 points (X)
1 / 1: 30.00
2 / 2: 29.00
3 / 3: 28.50
4 / 4: 31.00
5 / 5: ....
6 / 6: 26.00
7 / 7: 39.00
8 / 8: ....
9 / 9: -31.00
yes?
Hope this helps
With Regards
Jaison
On Sat, 25 Sep 2004, Jordan Dawe wrote:
> jammal Tanclei wrote:
>
> > Hi, Ferret Users.
> >
> > I need to change the value of 0.0 to "NaN" because after that I'm
> > going to use function of @FLN to do interpolation at the boundary of land.
> >
> > Is there anybody to help me?
> >
>
> You can do something like this:
>
> let var1 = if data lt 0.0 then data
> let var = if var1 gt 0.0 then data else var1
>
> This should leave 0.0 undefined in var.
>
> Jordan
>
--
___________________________________________________
Jaison Kurian
Centre for Atmospheric and Oceanic Sciences
Indian Institute of Science
B A N G A L O R E 560 012
Ph: +91-80-3942505
+91-80-3600450
Fax:+91-80-3600865
___________________________________________________
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement