Reading regular data from a file. [message #1148] |
Fri, 16 July 1993 13:22 |
jabarone
Messages: 15 Registered: May 1993
|
Junior Member |
|
|
Hi,
I am trying to read regular 3-D data of the form -
x y z
from a file. This data is in block format meaning that there are
a certain number of data blocks in the file each with a fixed number
of points. Within these data blocks x remains fixed while y varies
and z = f(x,y). Is there a general IDL procedure or has someone come
up with a procedure that can read this data into arrays suitable
for use with the surface procedure. What I mean is if the file
contains M blocks with N points in each block, is there a way
to read the x, y, and z values intop arrays:
X(M), Y(N), and Z(M,N)
where X(m) corresponds to the first x value in each block,
Y(n) corresponds to the nth y value in each block (n ranging from 0:N-1),
and Z(m,n) is the nth z value in the mth block.
I'd like this procedure to be general meaning it should be able
to handle any block dimensions as long as they are regular through out
the file. I figured that counting the number of points and then counting
the number of elements that stay fixed in a block would do the trick since
they would give me the M and N dimensions I need, but is there a better,
quicker way to do this?
Thanks in advance.
John Barone
jabarone@athena.mit.edu
|
|
|