Re: Heterogenous data and hdf_vd_write [message #12537] |
Thu, 20 August 1998 00:00 |
Charles Cavanaugh
Messages: 8 Registered: July 1997
|
Junior Member |
|
|
<HTML>
Never mind. I figured it out by inverting my HDF read routine.
<BR>In case anyone cares, here's a clip from my HDF test writer:
<P>pro lmc_values__define
<BR> tmp = { lmc_values, $
<BR>
stares : 0, &nbs p; &nbs p; &nbs p; &nbs p; &nbs p; &nbs p; &nbs p;
$
<BR>
times & nbsp; : replicate (' &nbs p; &nbs p; &nbs p; &nbs p;
', 2), $
<BR>
engineering : fltarr (2, 92), &n bsp; &n bsp; &n bsp; &n bsp; &n bsp;
$
<BR>
signals : fltarr (2, 4, 2), &nb sp; &nb sp; &nb sp; &nb sp;
$
<BR>
curves : fltarr (6, 4, 40) &nb sp; &nb sp; &nb sp; &nb sp;
}
<BR>end
<BR>
<P>pro WriteSomeHDFInfo, hdfinfo
<BR> buffer = bytarr (2 + 56 + 736 + 64 + 3840)
<P> lmcvalues = {lmc_values}
<BR> lmcvalues.stares & ;nbsp; = 29
<BR> lmcvalues.times & nbsp; = ['1992-08-12T20:30:00.000000Z',
'1994-04-04T07:30:00.000000Z']
<BR> lmcvalues.engineering = findgen (2, 92)
<BR> lmcvalues.signals = findgen (2, 4, 2)
+ 70000.0
<BR> lmcvalues.curves & ;nbsp; = findgen (6,
4, 40) + 10.0
<P> buffer[ 0] = byte (lmcvalues.stares, 0, 2)
<BR> buffer[ 2] = byte (lmcvalues.times[0])
<BR> buffer[ 30] = byte (lmcvalues.times[1])
<BR> buffer[ 58] = byte (lmcvalues.engineering, 0, 736)
<BR> buffer[794] = byte (lmcvalues.signals, 0, 64)
<BR> buffer[858] = byte (lmcvalues.curves, 0, 3840)
<BR> hdf_vd_write, hdfinfo.train1.cold.dataid, 'Stares,Times,Engineering,Signals,Curves',
buffer, nrecords = 1, /full
<BR>end
<BR>~
<BR>
<BR>
<BR>
<P>Charles Cavanaugh wrote:
<BLOCKQUOTE TYPE=CITE> I'm having problems writing heterogenous data
to an HDF vdata
<BR>using IDL's hdf_vd_write. Specifically, I want to write a structure,
<BR>which has fields of different types and orders and which represents
<BR>one vdata record, to my HDF file. I'l l need to do this repeatedly.
<P><I>IDL Scientific Data Formats </I>says I cannot write IDL structures
<BR>directly to a vdata, I must put the data into a byte array first.
I have
<BR>no experience converting floating point arrays into their respective
<BR>byte representations.
<P>I would greatly appreciate any help on these matters.
<BR>
<P>TIA,
<P>Charles Cavanaugh
<PRE>--
Charles Cavanaugh
MOPITT & HIRDLS Programs
National Center for Atmospheric Research
Boulder, CO, USA
email: cavanaug@ucar.edu
phone: (303) 497-2919
fax : (303) 497-2920</PRE>
</BLOCKQUOTE>
<PRE>--
Charles Cavanaugh
MOPITT & HIRDLS Programs
National Center for Atmospheric Research
Boulder, CO, USA
email: cavanaug@ucar.edu
phone: (303) 497-2919
fax : (303) 497-2920</PRE>
</HTML>
|
|
|