how read a file of complex? [message #10633] |
Fri, 02 January 1998 00:00 |
Ferdinando Iavarone
Messages: 10 Registered: October 1997
|
Junior Member |
|
|
Hi all,
HAPPY NEW YEAR.
I have a data-file containing a matrix. Each element of matrix has the
form
(real part, imaginary part)[1] with each one LONG.
1) How create a matrix with structure [1] to read in a single pass the
file?
2) I tried with a pro of type reported below (probably very slow for
giant matrix), but after execution IDL results blocked
(I work with IDL 5.0 /windows 95)
Thank
pro prova,n,m,nomefile,immagine
tmp1=0l
tmp2=0l
re=lonarr(n,m)
im=lonarr(n,m)
openr,1,nomefile
for i=0,n-1 do begin
for j=0,m-1 do begin
readu,1,tmp1,tmp2
re(i,j)=tmp1
im(i,j)=tmp2
endfor
endfor
immagine=complex(re,im)
close,/all
end
--
Nando Iavarone
Laureando Gruppo Telerilevamento
Dipartimento Interateneo di Fisica
Via Amendola, 173
70126 BARI
ITALY
Tel.: +39 80 5443166
Fax.: +39 80 5443165
e_mail: iavarone@axpba0.ba.infn.it
|
|
|