Getting Information
Contents:
Typical functions that you would use to get information regarding
a General Raster Image are as follows:
The gr_gi program reads file information and GR data set information for
data set 'Image_1' from the gr1.hdf file, and then prints it to the screen.
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.
Following is a detailed review of what this program does:
- Opens the HDF file called gr1.hdf in Read Only mode and
starts the GR interface.
- Gets the file information for gr1.hdf (GRfileinfo/mgfinfo) and prints it to the screen.
- Selects the data set with name "Image_1".
- Gets the data set information for "Image_1" (GRgetiminfo/mggiinf) and prints this to the screen.
- Terminates access to the GR image and the GR interface, and closes
the file.
The gr_gi program outputs the following information:
Number of Datasets: 1
Number of File Attributes: 0
Data Set Name: Image_1
Number of Components: 2
Number Type: 22
Interlace: 0
Number of Attributes: 0
Dimension 1: 15
Dimension 2: 10
Programs used in this tutorial:
[Compiling a program]