How do you add attributes to a GR object and how do you examine them?
You use the GRsetattr command. For file attributes, you pass it the file ID of the HDF file. For data set attributes, you pass it the identifier of the data set. For dimension attributes, you pass it the identifier of the dimension.
Take the program created for adding data to an SD object in a vgroup, add-data.c, and:
Run this program, and examine the resulting HDF file.
To see the file attributes, type:
hdp list -a addsdvg.hdf
To see the data set and dimension attributes, type:
hdp dumpsds addsdvg.hdf
You can also use the vshow command to examine the attributes:
vshow addsdvg.hdf +
You will notice that when you created the dimension attribute, it creates a Dimension Variable Name, and that the data for this is not set. Basically, the data for a dimension variable, is the scale.
Examine the resulting HDF file: hdp dumpsds addsdvg.hdf