[Thread Prev][Thread Next][Index]

Re: [ferret_users] reading sequence of files



Hi Ansley,
     Thanks for the solution. All my nc files have only variable, but when listing ..varnames  some files showing other than variable name for example time bounds which is unwanted for me. How to get only variable name. My files ..varnames as follows.
------------------------------------------------------------------------
 yes? use mld_praveen_mon_5807.cdf
yes? sh da
     currently SET data sets:
    1> ./mld_praveen_mon_5807.cdf  (default)
 name     title                             I         J         K         L
 MLD      SOMXL010[GT=TRUEMONTH@AVE]       1:190     1:60      ...       1:600
 
yes? list ..varnames
             VARIABLE : ..VARNAMES
             FILENAME : mld_praveen_mon_5807.cdf
             SUBSET   : 2 points (X)
 1   / 1:"TRUEMONTH_bnds"
 2   / 2:"MLD"          

yes? use mldepth_monthly_raghu_8609.cdf
yes? list ..varnames
             VARIABLE : ..VARNAMES
             FILENAME : mldepth_monthly_raghu_8609.cdf
        "MLD"
-----------------------------------------------------------------------------------------------------

Thanks,

-


On Tue, Nov 16, 2010 at 2:39 AM, Ansley Manke <Ansley.B.Manke@xxxxxxxx> wrote:
Hi -
If there is just one variable in the files, and assuming they are netCDF files, you can use Ferret's capabilities for getting dataset attributes to find the variable names.

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/VARIABLES#_VPINDEXENTRY_attrib_keywords

So, put something along these lines in a script,

 use "$1"
 let vnames = ..varnames
 let tempvar = `vnames[i=1]`

 ...  ! whatever commands you want, using variable tempvar

 cancel data/all

and then you can call this script for each dataset.


On 11/11/2010 10:29 PM, STEEVEN PAUL YERRAGUNTLA wrote:
Dear ferreters,
        I wanted to make a generalized script which executes the  sequence of data files having different variables, for instance one file having var SST other having var AIRT etc. As we know we can call dataset attributes  in the executing script using `SST,return=lend` , `AIRT, return=dset` etc. Is there any provision in ferret to call the variable name without mentioning directly.
I  gone through the weblink showing how to read sequence of datafiles which presumes the variable in common.
http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2006/msg00339.html

Thanks in advance,


--
Steeven Paul Y
Research Fellow
National Institute of Oceanography
Regional Center Visakapatnam (RCW)
INDIA.




--
Steeven Paul Y
Research Fellow
NIO RC Vizag
176 Lawsons Bay Colony
Visakhapatnam - 530017

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement