[Thread Prev][Thread Next][Index]

Re: [ferret_users] can not read two ascii files

Hi Addisu,
            In Ferret, the last loaded dataset will be the default
dataset. To access other datasets, either you have to specify their
number or name, as shown below. This rule is independant of the data
format. The "show data" command is very usefull to know the dataset

     FILE/var=var1  file1.txt
     FILE/var=var2  file2.txt

     show data

     ! 1st method
     plot    var2[d=2]  ! using dataset number
     plot/ov var1[d=1]  !         "

     ! 2nd method
     plot/D=2    var2   ! using dataset number
     plot/ov/D=1 var1   !         "

     ! 3rd method
     plot    var2[d=file2] ! using dataset name (path not required)
     plot/ov var1[d=file1] !       "

Also, it is always better to define a grid (combination of X,Y,Z & T
axes, as applicable) and read the ascii data onto that grid. For some
operations, this procedure is mandatory (one example is to read large
datasets). Here is few examples for defining grid for input ASCII data.

 ! for 1-D data along time

     define axis/t=1:31:1/units=days tfile
     define grid/t=tfile             gfile
     FILE/grid=gfile/var=var1 file1.txt

 ! for 2-D XY data

     define axis/x=30:120:1/units=longitudes xlon
     define axis/y=-30:30:1/units=latitudes  ylat
     define grid/x=xlon/y=ylat               gfile
     FILE/grid=gfile/var=something  somefile.txt

Relevant portions in User Manual to look for more information

Ch2 Sec1.    OVERVIEW
Ref Sec33.5. SHOW DATA_SET 
Ch2 Sec5.    ASCII DATA 
Ref Sec4.3.  DEFINE AXIS 
Ref Sec4.4.  DEFINE GRID 

Hope this helps,


On Thu, 15 Mar 2007, Addisu Hunegnaw wrote:

> Dear Ferret users
> I am just beggining to use ferret. I have to file to call into ferret, file1
> and file2.
> I used the command:
> FILE/VAR=first       file1
> FILE/VAR=second  file2
> When I tried to plot "second", it plots it but when I tried to plot "first"
> I get the error
>  **ERROR: variable unknown or not in data set: first
> The first file, file1 apparently does not exist any more as soon as I load
> the second file, file2
> Why is that ?
> Addisu

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement