Reading Attributes


Contents:



How to Read Attributes

To read and get information about attributes, you can use the following functions:

Sample Program

The following sample program shows how to read attributes in an HDF file (You can either download the C or FORTRAN program at the end, or just take a look at the HTML version with the HDF calls highlighted): If you have downloaded this program, then you can compile and run it. It reads the file attribute, SDS attribute, and dimension attribute that were created in the tutorial previous to this called "Adding Attributes".

Following is a detailed review of what this program does:


Output from Sample Program

All that this program does is output the values of the file attribute, SDS attribute, and dimension attribute added to sd.hdf in the previous tutorial.

 ... sd.hdf opened for READ ONLY access
 
 file_contents: storm_track_data
 valid range:  2  10
 dim_metric: millibars
 
 ... closing file

Download Sample Program (optional)

Programs used in this tutorial: [Compiling a program]