Getting Information
Contents:
To obtain information regarding SDSs in a file you can use the
following functions:
- SDgetinfo (sfginfo) - Retrieve the name, rank, dimension sizes, data types
and attribute count for a specified dataset.
- SDfileinfo (sffinfo) - Determine the number of datasets and global
attributes in a file.
The following sample program shows how you might get information regarding
SDSs in a 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 goes through every
dataset in an HDF file, and prints out the name, rank and number of attributes
in the file.
Following is a detailed review of what this program does:
Following is what this program outputs to the screen:
... sd.hdf opened for READ access.
name = data1
rank = 2
number of attributes = 0
... file closed
Programs used in this tutorial:
[Compiling a program]