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

Home » Public Forums » archive » Re: Reading into arrays with order > 2
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: Reading into arrays with order > 2 [message #17782 is a reply to message #17718] Mon, 08 November 1999 00:00 Go to previous message
Ivan Zimine is currently offline  Ivan Zimine
Messages: 40
Registered: February 1999
Member
Hi Steven,

You are trying to read into a subscripted variable which is passed to
readf by value
and not by reference so when readf finishes all3MomData is unchanged.

this should work (assumimg that all3MomData matches the file format,
size+data type)

temp=reform(all3MomData[0,*,*])

for i=0, n_elements(names3Mom)-1 do begin
openr, lun, names3Mom[i], /get_lun
readf, lun, temp
all3MomData[i,*,*]=temp
free_lun, lun
endfor


good luck,
Ivan

Steven Riley wrote:
>
> Assuming names3Mom is a 1D array of strings (of valid filenames) is there
> any reason why the following code will not read many files into a 3d array?
>
> FOR I=0,1 DO BEGIN
> close,1 & openr,1,names3Mom(I)
> readf,1,all3MomData(I,*,*)
> END
>
> I get no error messages, but when I look at my array it contains no data...?
> I'm quite sure the files being read contain data. Is this some inherent
> problem with readf and arrays with order > 2?
>
> Steven
>
> --
>
> Linacre College
> Oxford
> OX1 3JA
>
> 01865 - (2)81229 (W)
> 01865 - 209295 (H)
>
> www.linacre.ox.ac.uk/student_pages/steven_riley

--
Ivan Zimine
Dpt. of Radiology (MRI), Geneva University Hospitals
email: ivan.zimine@physics.unige.ch
tel. : (+41 22) 372 70 70
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: where() and IEEE NaN and other stuff...
Next Topic: Re: oplot problem - solved

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

Current Time: Fri Oct 10 23:11:56 PDT 2025

Total time taken to generate the page: 0.63892 seconds