[Thread Prev][Thread Next][Index]

Re: [ferret_users] Reading variables from an ascii file



First of all, you need to use the /SKIP qualifier to the FILE command to skip about 12 lines of header information.

Second, you need a fortran-style /FORMAT qualifier or read in free- form (see the manual). Ferret (or any program) will not know which of the input values are to be read and which to be skipped.

Third, it looks like you need to use the /ORD qualifier to tell ferret how the grid relates to the data records.

All this is described in the manual under the FILE command.

DEFINE AXIS/x=262.15:279.15:0.20/units=degree xaxis
DEFINE AXIS/y=18.05:18.05:1/units=degree yaxis

Why do you define these 1-point axes? Given the complex format you are trying to read, these may just confuse things. Take them out until you know it is reading ok.

Billy K

On 16 Feb 10, at 11:02 AM, Arturo Avila Rosas wrote:

Hi Ansley,
I am using the following commands but obviously variables are incorrect asigned
DEFINE AXIS/x=262.15:279.15:0.20/units=degree xaxis
DEFINE AXIS/y=18.05:18.05:1/units=degree yaxis
DEFINE AXIS/t="01-JAN-1960:00:00":"31-DEC-1960:23:00":1/Units=hours taxis
DEFINE GRID/x=xaxis/y=yaxis/t=taxis wgrid
FILE/GRID=wgrid/VAR="u10,dir" marino.txt
SAVE/FILE=marino.cdf u10,dir
plot/t=1-JAN-1960 u10
list/T="1-JAN-1960:01:00" u10
Any idea?
Cheers
Arturo
----- Original Message -----
From: Arturo Avila Rosas
To: Ansley Manke
Cc: ferret_users@xxxxxxxx
Sent: Friday, February 12, 2010 2:12 PM
Subject: Re: [ferret_users] Reading variables from an ascii file

Hiya Ansley,
This is a sample of what I want to read:

TIME SERIES OF INTEGRATED PARAMETERS AT EstGME-50-01 LAT. = 18.05000 LONG. = 271.94998
 |----- DATE ----|-------- WIND ----------
 |--------------- WAVES -----------------
 |--------------- WINDSEA ---------------
 |--------------- SWELL ----------------|
                  U10  DIR.  US   CD  TAUW
    HS    TP    TM   TM1   TM2  DIR. SPR.
    HS    TP    TM   TM1   TM2  DIR. SPR.
    HS    TP    TM   TM1   TM2  DIR. SPR.
  YYYYMMDDHHMMSS [M/S][DEG][M/S][1000] [%]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]

19600101000000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19. 19600101010000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19.
...
19601231230000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19.

TIME SERIES OF INTEGRATED PARAMETERS AT EstGME-51-01 LAT. = 18.05000 LONG. = 272.1500
 |----- DATE ----|-------- WIND ----------
 |--------------- WAVES -----------------
 |--------------- WINDSEA ---------------
 |--------------- SWELL ----------------|
                  U10  DIR.  US   CD  TAUW
    HS    TP    TM   TM1   TM2  DIR. SPR.
    HS    TP    TM   TM1   TM2  DIR. SPR.
    HS    TP    TM   TM1   TM2  DIR. SPR.
  YYYYMMDDHHMMSS [M/S][DEG][M/S][1000] [%]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]
   [M]   [S]   [S]   [S]   [S] [DEG][DEG]

19600101000000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19. 19600101010000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19.
...
19601231230000 7.2 278. 0.26 1.34 0.72 0.88 5.73 4.50 3.99 3.64 255. 26. 0.67 4.74 3.68 3.34 3.09 271. 21. 0.58 5.73 5.59 5.38 5.22 236. 19.

I made a C program to get rid off the headers and the date data so I've got an ascii file with only the valuable data
Thanks a bunch
Arturo


----- Original Message -----
From: Ansley Manke
To: Arturo Avila Rosas
Cc: oar.pmel.ferret_users@xxxxxxxx
Sent: Friday, February 12, 2010 1:30 PM
Subject: Re: [ferret_users] Reading variables from an ascii file

Hi Arturo,
We can help you better if you write back and show a sample of what the data look like. What is in each block of data?

Ansley

Arturo Avila Rosas wrote:

Dear ferreters,
How do I read an ascii file wich contains anual data from a grid of stations located in the gulf? Blocks of columns of variables are listed hourly from the first to the last day of the year. This
is done for each station so as to complete with all the stations.
Cheers
Arturo



[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement