Help! G4 problem reading ascii data [message #36605] |
Mon, 06 October 2003 07:35 |
David
Messages: 24 Registered: April 1997
|
Junior Member |
|
|
Hi all,
I am quite new to IDL and I am having what appears to be a serious
problem with IDL on a G4 Mac. I could really use some help. I read
the thread about the known G4 problem and it is not clear to me whether
this problem is related or not. I hope I am doing something stupid and
someone can point this out to me, but the code is very simple and I am
stumped.
I am running IDL 6.0 on a Mac G4 running 10.2.6.
The problem is that when I read ascii data from a file that has more
than 2 columns, the data does not read properly in columns beyond 1 and
2. The data is fine up to array item 255, but after that I get random
integer data. This sounds somewhat similar to the G4 problem discussed
earlier so I am wondering if it is the same issue and what I can do about
it.
Here is the code that I am using:
datatemplate=ascii_template( '~jacksond/testdata.txt')
data=read_ascii(filepath('testdata.txt',root_dir='~jacksond' ),template=datat
emplate)
for i=250,260 do begin
print, data.field1[i], data.field2[i], data.field3[i], data.field4[i]
endfor
END
I have included the data file that I am using. It is simple 4 columns
of tab delimited floating point data with 512 entries. During the
ascii_template command, I choose "fixed width" on step one and the
defaults for everything else. The output of this program looks like
the following:
-0.996365 0.0734110 2.00308 0.0737210
-0.997232 0.0611700 2.00226 0.0614770
-0.997951 0.0489190 2.00159 0.0492240
-0.998521 0.0366610 2.00107 0.0369630
-0.998941 0.0243960 2.00070 0.0246970
-0.999212 0.0121280 2.00048 0.0124270
-0.999334 -0.000140000 3.00000 4.00000
-0.999306 -0.0124100 5.00000 6.00000
-0.999128 -0.0246800 6.00000 9.00000
-0.998800 -0.0369500 3.00000 1.00000
-0.998322 -0.0492100 5.00000 4.00000
while the output of the command head -n 260 testdata.txt | tail -n 10
-0.996365 0.073411 2.003076 0.073721
-0.997232 0.061170 2.002258 0.061477
-0.997951 0.048919 2.001589 0.049224
-0.998521 0.036661 2.001069 0.036963
-0.998941 0.024396 2.000701 0.024697
-0.999212 0.012128 2.000482 0.012427
-0.999334 -0.000143 2.000414 0.000155
-0.999306 -0.012415 2.000496 -0.012116
-0.999128 -0.024686 2.000729 -0.024386
-0.998800 -0.036953 2.001111 -0.036652
As you can see, the IDL data in columns 3 and 4 "go bad" at array
element 256. In fact, I just noticed that in column 2, the data beginning
ast element 256 is no longer exactly the same as the original. Weird.
I'd appreciate any help/advice I can get on this problem.
David
--
David P. Jackson
Associate Professor
Dept. of Physics & Astronomy
Dickinson College
Carlisle, PA 17013
(717) 245-1073
|
|
|