Re: how to make it an array? [message #39160] |
Mon, 19 April 2004 09:47  |
Gauri Kulkarni
Messages: 2 Registered: April 2004
|
Junior Member |
|
|
Maybe what you are looking for is the procedure READCOL. It reads any file
with data in comlumn form. It ignores anything in that file that is not in
the column form. It usually comes with astronomy libraries, but very easy
to find on on the web and download. Here is a sample:
IDL> readcol,'random_catalog_xyz.dat',x,y,z
% Compiled module: READCOL.
% Compiled module: NUMLINES.
% READCOL: Format keyword not supplied - All columns assumed floating
point
% Compiled module: GETTOK.
% Compiled module: REPCHR.
% Compiled module: STRNUMBER.
% READCOL: 957153 valid lines read
IDL> array = transpose([[x],[y],[z]])
IDL> help,array
ARRAY FLOAT = Array[3, 957153]
IDL>
It took about 30 seconds to read those many rows. So it's fairly fast.
Hope this helps.
Gauri.
On Sun, 18 Apr 2004, Thomas Nehls wrote:
> Hi,
>
> as the result of calculations I produced a 3 column .dat-file . While
> using /APPEND and after calculation of some images of 400x400 the length
> of the file is about 1,000,000 rows.
>
> For further calculation I want to read the .dat-file(using read_ascii?)
> into an array. I already got the file read but the type is struct and
> the value is anonymus.
> How can I make it an array?
> Thanks
> Tom
>
>
|
|
|