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

Home » Public Forums » archive » Re: Read 3D array into IDL
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: Read 3D array into IDL [message #39174 is a reply to message #39172] Wed, 28 April 2004 12:55 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Tmorri wrote:
> I have a 3D array [409x233x5] in my C drive, I need to read the data into
> IDL and then process it.
> Could anyone tell me how to read the data?

Not until you explain the precise format of the data. Is the array an
array of integers, floating point numbers, or strings? If it's numeric
data, are the numbers stored as binary data or as ascii text strings? If
binary format is used, how many bytes are used for the numbers? If
it's in text format, what delimiters are used, if any?

In what order to the three dimensions vary? For instance, consider a
2x2x2 array named 'array'. One of the possible orders it could be
printed out in is the following (this is the natural order for IDL):

array[0,0,0] array[1,0,0]
array[0,1,0] array[1,1,0]

array[0,0,1] array[1,0,1]
array[0,1,1] array[1,1,1]

On the assumption that your data is stored as an ascii text file
containing 409*233*5 floating point numbers, with natural IDL dimension
ordering, then the following should do the job quite nicely:

data = FLTARR(409,233,5)
OPENR,infile,'C:\path\name\filename.txt',/GET_LUN
READF,infile,data
CLOSE,infile
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Randomu Period
Next Topic: Re: IDL 6.0.x crashes on mac os x?

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

Current Time: Sat Oct 11 10:10:35 PDT 2025

Total time taken to generate the page: 0.96311 seconds