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

Home » Public Forums » archive » New Binary Data I/O Tools
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
New Binary Data I/O Tools [message #17289] Thu, 30 September 1999 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
I've just posted a couple of new procedures (BINWRITE and BINREAD) which
allow I/O of arrays in IDL using a simple, portable binary format, e.g.

Write array(s) to a portable output file:

a = dist(256)
b = bindgen(100)
openw, lun, 'test.dat', /get_lun
binwrite, lun, a
binwrite, lun, b
free_lun, lun

Read array(s) from the above input file:

openr, lun, 'test.dat', /get_lun
binread, lun, c, header=header
binread, lun, d
free_lun, lun
print, header
help, c, d

The advantage of these routines is that they provide a way to write
binary data that can be read back easily in IDL, or other environments
(FORTRAN, C, Matlab etc.), on any host platform without using SAVE, XDR,
or Standard Data Formats. The SAVE and XDR formats in IDL are useful in
certain cases, but they produce files which can be difficult to read in
other environments. Standard formats like CDF, netCDF, or HDF get around
this problem, but they require the user to learn a new API, which can
sometimes be a bit daunting.

You can find BINWRITE and BINREAD, and a description of the format, at
http://cimss.ssec.wisc.edu/~gumley/binarytools.html

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Widgets
Next Topic: Re: exporting IDL data to matlab

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

Current Time: Wed Oct 08 19:27:54 PDT 2025

Total time taken to generate the page: 0.00388 seconds