[Thread Prev][Thread Next][Index]

Re: large number of variable



On Mar 21, 11:59am, Vincent PAROUX Stagiaire ENIB wrote:
> Subject: large number of variable
> Hi,
>
> I use FERRET Version 4.4, and I would like to read an ASCII file which
> contains 22 variables, stored in a single column each
> Example:
> (Col_1   Col_2  ...  Col_22)
>
>   1      oui          120
>   2      oui          119
>   .       .            .
>   .       .            .
>   .       .            .
>   5      non           130
>
> I tried to read this file with the command:
> FILE/VAR="VAR_NAME1,VAR_NAME2,...?VAR_NAME22" ascii_filename
> But when I tried the command:LIST VAR_NAME1 I have this answer:
>  **TMAP ERR: unknown error number
>              Last or next-to-last record read:
>  Value1 value2 value3 value4 ... value11 val
>              Data set: ./ascii_filename
>              Data file: ./ascii_filename
> where valueN are the value of the first line of my file.
>
> My question is:
> Is there a max number of variable that I can use with ferret or if not
> How can I do to read my file ?

There are 2 problems here. First, ferret is limited to (I think) 15 variables
per ascii file. Second, you are trying to read ascii data in column 2. The
second problem is the easiest to address - change the Oui and Non to numerical
equivalents (e.g. 0 for non and 1 for oui). Ferret does not read character data
- you could also skip this via the format command. For example:

FILE/VAR="VAR_NAME1,VAR_NAME2,...VAR_NAME21"/FOR=(f4.0,4x,20f4.0)
ascii_filename

This format fix can also work for the first problem. Consider your data split
into 2 sets of variables VAR1-VAR11 and VAR12-VAR22, for example. Then, using
Unix symbolic links create 2 symbolic links, for example:

ln -s file1.dat ascii_filename
ln -s file2.dat ascii_filename

Then (assuming that every variable takes up 4 columns), you would then access
your data via the following example commands:

yes? FILE/VAR="VAR1,VAR2,...,VAR11"/FOR=(11f4.0) file1.dat
yes? FILE/VAR="VAR12,VAR13,...VAR22"/FOR=(44x,11f4.0) file2.dat

This is assuming that you change your ascii data to numbers - NOTE - read in
integer data as real, for example - if in fortran you would read a variable as
i4, in ferret use f4.0

Hope this helps, Mark

-- 
-------------------------------------------------------------------------------

	      Mark Verschell (verschell@coaps.fsu.edu)
	      Center for Ocean and Atmospheric Prediction Studies
	      Florida State University
              2035 E. Paul Dirac Drive
              R.M. Johnson Bldg. - Suite 200
	      Tallahassee, FL  32306-3041
	      (904) 644-6532              (904) 644-4841 (fax)


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement