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

Home » Public Forums » archive » Re: Very slow IDL vs Matlab (ascii file reading)
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: Very slow IDL vs Matlab (ascii file reading) [message #36883 is a reply to message #36873] Wed, 05 November 2003 08:54 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Good work !

Reimar




Richard G. French wrote:
> OK, I figured out a work-around using STRSPLIT:
>
> ; write the data file
>
> x=make_array(/double,value=999.d0,660L*496L)
> w=17L*660L*496L
> openw,lun,/get_lun,'Mydata.dat',width=w
> PRINTF,lun,x
> free_lun,lun
> ; read the file as a single string
> s=''
> openr,lun,'Mydata.dat',/get_lun
> readf,lun,s
> IDL> help,s
> S STRING = ' 999.00000 999.00000
> 999.000'...
> free_lun,lun
> ;convert the long string to desired floating point array
> Data=fltarr(660,496)
> Reads,strsplit(s,/EXTRACT),data
>
> This is fast, and should do what you need without having to split the file
> itself in to shorter lines. You can do it all in IDL.
>
>
> Dick French
>


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to solve a homogeneous system(Ax=0) with a gauss elimination method that x is not zero.
Next Topic: Simple seismic ray tracing code?

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

Current Time: Wed Oct 08 17:33:36 PDT 2025

Total time taken to generate the page: 0.00415 seconds