[Thread Prev][Thread Next][Index]

Re: [ferret_users] Reading an ascii file



Hi Ben,
If your data is listed as 10 values per line, then you need to add the /columns=10 qualifier on your read statement. If the values are separated by a comma, you shouldn't need to specify the delimiter, but its okay if you do anyhow, I suppose. Also, make sure your file name fits on one line or else use the line continuation "\".

file/grid=gax1/columns=10/var="tb_scale" 20061018_16\
2141_19026.dat


Steve G.



Quoting Ben Burford <benb@restec.or.jp>:

Hi,

I'm trying to read data from an ascii file.  The ascii values are comma deli
mited with 10 values to a line (with a return or linefeed return at the end
of each line).  There's no header or variable name in the file, just 2,500 v
alues, comma separated, representing xy pixels, 50 by 50.

Following is my script:

define axis/x=133.02E:135.52E:.05 xax
define axis/y=5.8N:8.2N:.05 yax
define axis/z=1:1:1 zax
define grid/x=xax/y=yax/z=zax gax1
file/format=delimited/delim=","/type=text/grid=gax1/var=tb_scale 20061018_16
2141_19026.dat
let tb=tb_scale/10
set var/bad=-32767 tb
set var/title="Brightness Temperature" tb
set var/units="Kelvin" tb
shade tb


Here is the error message:

**ERROR: unknown data set: invalid data set number for SET DATA/EZ
SET DATA/EZ/format=delimited/delim=","/type=text/grid=gax1/var=tb_scale 2006
1018_162141_19026.dat
Command file, command group, or REPEAT execution aborted
STOP -script mode, ERROR RUNNING SCRIPT statement executed


Any help in understanding the error, and getting the right format declaratio
n, would be greatly appreciated.

By the way, if the problem is that there are returns after each 10 values I
can easily reformat the data into lines of 50 values, or into one continuous
stream with no returns.



Another question, if I may.  Instead of using the above format, can I specif
y the x and y axis by giving the first value and then indicating that I want
50 values on a grid spacing of .05 degree.  In other words, instead of what
I have now:
define axis/x=133.02E:135.52E:.05 xax
define axis/y=5.8N:8.2N:.05 yax

could I put something like (what is the right format)?:
define axis/x=133.02E:n=50:.05 xax
define axis/y=5.8N:n=50:.05 yax


Thank you very much in advance,

Ben






=======================================================
Stephen R. Guimond
Graduate Research Assistant
Center for Ocean-Atmospheric Prediction Studies (COAPS)
Tallahassee, FL 32304
=======================================================

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



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement