comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Help! G4 problem reading ascii data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Help! G4 problem reading ascii data [message #36603 is a reply to message #36602] Mon, 06 October 2003 08:28 Go to previous messageGo to previous message
David is currently offline  David
Messages: 24
Registered: April 1997
Junior Member
Hi all,

It appears as though I'm an idiot. Looking at the data below, I saw that
the integer data in column 3 was not quite random, but was related to the
inconsistencies in the data in column 2. I tried the same routine, but did
not use the "fixed width" option and everything worked fine. I don't know
why I didn't try this earlier. I guess I was lulled into believing the
fixed width option was what I wanted because it says in parentheses (data is
in columns) next to it. Well, my data is in columns and this seemed like
the appropriate option. Anyway, it works fine with the "delimited" option.

Sorry to have wasted your time.

Perhaps you got a chuckle out of this as you recalled "I remember when I was
that inexperienced with IDL"

David

"David" <dpjackson@yahoo.com> wrote in message
news:A4fgb.214$Yj.177490@monger.newsread.com...
> 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
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Reading and using GrADS format binary data in IDL
Next Topic: IDL Student Edition 'splash' screen

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 13:14:54 PDT 2025

Total time taken to generate the page: 0.47948 seconds