IDL: are dynamic arrays supported? [message #10880] |
Wed, 11 February 1998 00:00 |
dEdmundson
Messages: 23 Registered: February 1998
|
Junior Member |
|
|
I am a new user of IDL. I am trying to input data for a 2d surface
created by a Fortran program. The data has the following form:
xnum
x1 x2 x3 x3 x5
x6 x7 x8 ...
y1
z1 z2 z3 z4 z5
z6 z7 z8 ...
y2
z1 z2 z3 ...
Here, xnum is the number of x gridpoints, x1..xn form the x(xnum) vector,
y1, y2, ... form the y(ynum) vector and the z1..zn are the height data
at the current y value. The problem is that ynum isn't explicitly
listed at the beginning of the file.
The obvious solution is to read the file twice, first to glean ynum,
and second to actually grab the data. However, I wonder is it possible
(and desirable) to import the data in a single pass? My IDL manual
suggests creating a 2D array bigger than I think I will need. This is
inelegant and I wonder about some form of dynamic array.
Thanks very much for any help you can provide.
Regards,
Darran Edmundson
Optical Sciences Centre, ANU
dEdmundson@bigfoot.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
|
|
|