[Thread Prev][Thread Next][Index]

Re: Getting number of variables



Hi Sudheer,
             I always prefer to read the data from ASCII file to a 
properly defined grid instead of depending on the default way. If
you are doing it in this way then you can use the variable just like
one in a good NetCDF file. IF you are interested please have a look at
Ferret manual : Ch2 Sec5.1.  Reading ASCII files , and 
Ref Sec4.2.  DEFINE AXIS.

 Here is an example. If you have any doubts please let me know.

 Hope this helps 

 With Regards

 Jaison 

!-------------example.dat--------------
29.50
28.95     
-999.99
27.30
28.60
29.40
-999.99
29.50
28.60
28.30
!-----------example.jnl---------------
! Let us read the data in example.dat to a proper grid/axis.
!   we have 10 data values, so define an axis with 10 points.
!   define a grid only with this axis, and read the data onto this
!   grid.

    DEFINE AXIS/x=1:10:1  xfile
    DEFINE GRID/x=xfile   gfile

    FILE/grid=gfile/var=var1 num_of_points.dat
    set var/bad=-999.99 var1    ! set only the missing value..OR
    ! set var/bad=-999.99/title=""Temperature"/units="^oC" var1
    list var1
 
    let vardev      = var1 - var1[i=@AVE]
    let vardevsq    = vardev^2
    let sumsqvardev = vardevsq[i=@sum] 

! now ..to get the number of valid data points use @NGD..simple one
! please note that here `var1,return=isize` - var1[x=@nbd] will also
! return accurate value(8).

    let good_pts    = var1[i=@NGD] 
    list good_pts

    let myoutput = sumsqvardev/good_pts
    list myoutput

!-----------------end of example.jnl--------------------------

On Mon, 6 Dec 2004, Sudheer Joseph wrote:

> Dear Users
>                         I would like to get  variance calculted by defining
> file/var=var1  vardat.dat
> ! The axis under consideration is irregular
> let vardev=var1-var1[x=@ave]
> let vardevsq= vardev^2
> let sumsqvardev=vardevsq[x=@sum]
> and then to devide it by the number of points i wanted to get the actual 
> number of points
> I tried using the `var1,return=size` - var1[x=@nbd] but is not working since 
> the size of axis is not limited
> it gives a return of 20000+ value which is the default ferret axis size
> I would like to get the actual number of variables to devide the sum of 
> suired deviations.
> I realise that there is a function @var existing in ferret but wanted to use 
> the manual calculation for some cross checking
> can any one help
> thanks,
> sudheer
> 
> 
> ***************************************
> Dr. Sudheer Joseph
> Indian National Centre for Ocean Information Services
> Gajularamaram B.O., IDA Jeedeemetla S.O.
> Via Pragathi Nagar, Kukatpally, Hyderabad
> Pin:5000 55
> Tel:+91-40-23044600(R)
> Tel:+91-40-9440832534(Mobile)
> Tel:+91-40-25503595(O)
> Fax:+91-40-25503596(O)
> E-mail:sjo@rediffmail.com;
> callsjo@yahoo.com;
> sjo@incois.gov.in.
> Web- http://oppamthadathil.tripod.com
> ***************************************
> 
> _________________________________________________________________
> All the news that matters. Just the way you like it. 
> http://www.msn.co.in/News/ Only at MSN News!
> 

-- 
___________________________________________________

    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