[Thread Prev][Thread Next][Index]

Re: 2 bad values



Hi Ben,
          There is no need to replace -32768 or -8888 by the other value 
(or with 0) in order to set both of them as missing values. Instead you
can define a new variable in Ferret and get it done as follows...

!---example.jnl---------------------------
!
! dummy data with two missing values (-32768 & -8888)

      let myvar = XSEQUENCE({10,12,0,13,14,-32768,32,24,-8888,50,32,12})

! devide data by 10 as needed
  
      let myvarby10 = myvar/10

! 1st method
!===========
! set the fist missing value explicitly

      set var/bad=-3276.8 myvarby10

! define a new variable such that the second missing_value/10 will became
!             undefined

      let myvar_new1 = IF myvarby10 NE (-888.8) THEN myvarby10
      list myvar_new1

! 2nd method
!===========
! define a new variable so that both the missing values are in effect

       let myvar_new2 = IF myvarby10 NE (-3276.8) AND myvarby10 NE \
                                (-888.8) THEN myvarby10
       list myvar_new2
!
! So you can use this newly defined variable for further calculations/
!     plotting/create a new NetCDF file
!   set var/title="Variable with missing values corrected"/units=\
                   "myunits" myvar_new2    ! or myvar_new1
!   save/file=newfile.nc/append myvar_new1 ! or myvar_new2
!
!--------------------end of example.jnl-------------------

Hope this helps

With Regards 

Jaison 

On Fri, 5 Nov 2004, benb wrote:

> Hello All,
> 
> I have data that has two values for bad values (-32768 and -8888).  I have t
> o divide my data by 10 so I used:
> set var/bad=-3276.8
> 
> I want to set both values to be recognized as bad values.  The documentation
>  talks about this being possible.  Does anyone know how to make it work?
> 
> 
> Also, if someone can show me how to (for example use a shell script to) chan
> ge all -8888 values to 0 (or change all -8888 values to -32768) this would g
> et me by my main problem for now.
> 
> Thank you,
> 
> Ben
> 

-- 
___________________________________________________

    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