Coyote's Guide to IDL Programming

Better IDL HDF Documentation

QUESTION: I can't make heads or tails of the IDL HDF scientific file format documentation. Can you help me read and write an HDF file?

ANSWER: There really is no other way to say this: the IDL HDF documentation is not very good. What was really missing for me when I started to learn how to read and write HDF files was a coherent explanation of the HDF application programming interface (API). Since I couldn't find one, I wrote my own. It eventually became a chapter on reading and writing HDF files that I included in IDL Programming Techniques.

The chapter covers the HDF scientific data format in general, but it specifically shows you how to read and write scientific data sets (SDS), including data sets with unlimited dimensions. In addition, you will learn how to read and write file and SDS attributes (the metadata that can be stored with the data itself), how to use dimensions and scales, and how to store a color palette with your HDF file, so the person working with your data sees exactly what you see. Here is a table that describes the API for the SD interface. I don't think I could have figured anything out without this table!

The API for the SD interface. (13K)


HDF Example Files

If you are not the type who likes to read documentation (even good documentation), then you can download the two example programs from the HDF chapter. These are well documented and will give you some insight into how you might go about reading and writing an HDF file. The program HDFWrite shows you how to write an HDF file. The program HDFRead shows you how to read the HDF file you just wrote.

In January 1999 Research Systems announced that they had formed a parnership with Fortner Software, a leading HDF software developer. I expect new products soon. In the meantime, one of the best sources of HDF information is the HDF Information page at Fortner Software. In particular you can find good links to the latest HDF documentation.

Web Coyote's Guide to IDL Programming