Very slow IDL vs Matlab (ascii file reading) [message #36899] |
Tue, 04 November 2003 12:55 |
Marcin Jakubowski
Messages: 5 Registered: October 2001
|
Junior Member |
|
|
Hi all,
I've tried to read an ASCII file, which is composed of one very long row
(660*496) double precision numbers, each of them delimited with
tabulator. In Matlab 6.5 I am using small program
=============================================
fid = fopen('Mydata.dat');
data = fscanf(fid,'%g',[660,496]);
fclose(fid)
=============================================
and it takes about one second to read the file. If I try to do similar
in IDL 6.0
=============================================
data = FltArr(660, 496)
OpenR, lun, 'Mydata.dat', /Get_Lun
ReadF, lun, data
Free_Lun, lun
=============================================
then it takes about 20 minutes (!!!) to read the same file. What causes
the problem? Unfortunately I need to use the IDL as it is a part of huge
code written in IDL. Is it any chance to shorten that time?
Many thanks in advance,
Marcin
P.s. I've performed checks on PC and Linux machines and the outcomes are
similar.
|
|
|