Re: read_ascii for many rows / possible to create automatic names for variables [message #57153 is a reply to message #57152] |
Wed, 05 December 2007 05:55   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bmey writes:
> as output from a spectrometer i obtain an ascii-file with many (more
> than 1024) columns and a few hundred rows. Most of the columns (1024
> of them) refer to a specific pixel of the spectrometer.
> Is there an effective way to read this file and to obtain each column
> as own variable? I do not want to type an own name for each of the
> columns, so i hope that there is a way to have a "dynamic name".
>
> Something like:
>
> data=read_ascii(file) & data=data.(0)
>
> pixel1=data(4,*)
> pixel2=data(5,*)
> ....
> pixel1024=data(1027,*)
>
> But to have idl to count from 1 to 1024.
>
> I hope it is possible to understand what i want to do.
I think you ought to be SURE that's what you want. It
doesn't sound like a good idea to me. Just read the
data all at once, and you have any column you like,
just as an index into the data array.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|