Re: Need ideas for a data structure [message #3073] |
Fri, 04 November 1994 17:22  |
mark_cadwell
Messages: 10 Registered: February 1994
|
Junior Member |
|
|
I don't know about IDL, but in PV-Wave I created a flexable record type
that works similarly to what you describe.
There is a set of non-changing header elements with things like titles,
axes annotation, data start and stop times, etc. There is also an element
that contains the size of the data arrays that follow. The file is opened
and read into PV-Wave with a READU function call. You have to create a
data structure in which to put the stuff you read. You can define one
data structure that has everything up to and including the element that
tells you array sizes.
Once you have that information, use it to create a second data structure
that has all the header stuff AND arrays of the proper size. Rewind the
data file with the function "POINT_LUN, UNIT, 0". This sets the I/O
pointer back to the beginning of your file so you can read it again (this
time with your data arrays).
It may not be the most elegant solution, but it has worked very well for
me. The only thing you have to look out for is that the data arrays must
start on a fullword boundry. If you need to, you can pad your data
structures with a few empty bytes to get to the fullword boundry.
--
----------------------------------
mark_cadwell@qmail4.trw.sp.com
|
|
|