The HDF_SD_ATTRINFO procedure reads or retrieves information about an SD attribute. The attribute can be global or from a specific dataset. If an attribute is not present, an error message is printed.
Set this keyword to a named variable in which the total number of values in the specified attribute is returned.
sd_id = HDF_SD_START('demo.hdf') ; Open an HDF file and start the SD interface.
gindex = HDF_SD_ATTRFIND(sd_id, 'TITLE') ; Find a global attribute
HDF_SD_ATTRINFO, sd_id, gindex, NAME=n, TYPE=t, COUNT=c, $
DATA=d, HDF_TYPE=h ; Retrieve attribute info.
HELP, n, t, c, h ; Print information about the returned variables.
D STRING = '5th Ave Surf Shop'
sds_id = HDF_SD_SELECT(sd_id, 0) ; Return the SD dataset ID for the first dataset (index 0).
dindex = HDF_SD_ATTRFIND(sds_id, 'LOCATION')
;
Find a dataset attribute.
HDF_SD_ATTRINFO,SDS_ID, dindex, NAME=n, TYPE=t, COUNT=c, DATA=d
;
Retrieve attribute info.
HELP, n, t, c, d ; Print information about the new returned variables.
HDF_SD_ATTRFIND , HDF_SD_ATTRSET , HDF_SD_CREATE , HDF_SD_SELECT , HDF_SD_START