Example of Automatic HDF Code Generation Using a Perl Script

The basic elements (or records) of the Level 1, Level 2 and Browse data produced by ASC are defined by C data structures contained in include files. Based on these data structures, C code is created that will initialize an HDF file and do the reading and writing.

To simplify this process, the ASC has written a perl program (hdfgen.pl), which takes a data structure definition (an include file) as input and generates all the HDF calls needed to read and write the data record. The user interacts with the data at the level of read_Cstruct and write_Cstruct instead of the individual data element level that HDF requires. Use of the perl script helps to reduce software development time and minimize coding errors.

Descriptions of the subroutines generated by hdfgen.pl.

An example illustrating how hdfgen.pl works can be downloaded as a zip-compressed package or as individual files at:


or if this is the CD version it will be in the top directory.

You'll need a C-compiler, perl, and HDF libraries installed on your system to play with the example.

The example includes these files:

Our Email Address: asc@srl.caltech.edu

Last Updated: 3 Dec 1998

Return to ASC Home Page