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.
HDF_SD_ATTRINFO, SD_id, Attr_Index [, COUNT=variable] [, DATA=variable] [, HDF_TYPE=variable] [, NAME=variable] [, TYPE=variable]
An SD interface ID as returned by HDF_SD_START (i.e., a global attribute's "SDinterface_id"), or HDF_SD_SELECT/HDF_SD_CREATE (i.e., a dataset's "SDdataset_id").
The attribute index, can either be obtained by calling HDF_SD_ATTRFIND if a particular attribute name is known or can be obtained with a 0-based index sequentially referencing the attribute.
Set this keyword to a named variable in which the total number of values in the specified attribute is returned.
Set this keyword to a named variable in which the attribute data is returned.
Set this keyword to a named variable in which the HDF type of the attribute is returned as a scalar string. Possible returned values are DFNT_NONE, DFNT_CHAR88, DFNT_FLOAT32, DFNT_FLOAT64, DFNT_INT8, DFNT_INT16, DFNT_INT32, DFNT_UINT8, DFNT_UINT16, and DFNT_UINT32.
Set this keyword to a named variable in which the name of the attribute is returned.
Set this keyword to a named variable in which the IDL type of the attribute is returned as a scalar string. Possible returned values are BYTE, INT, LONG, FLOAT, DOUBLE, STRING, or UNKNOWN.
; Open an HDF file and start the SD interface:
SDinterface_id = HDF_SD_START('demo.hdf')
; Find a global attribute:
gindex = HDF_SD_ATTRFIND(SDinterface_id, 'TITLE')
; Retrieve attribute info:
HDF_SD_ATTRINFO, SDinterface_id, gindex, NAME=n, TYPE=t, COUNT=c,
$
DATA=d, HDF_TYPE=h
; Print information about the returned variables:
HELP, n, t, c, h
; Return the SD dataset ID for the first dataset (index 0):
SDdataset_id = HDF_SD_SELECT(SDinterface_id, 0)
; Find a dataset attribute:
dindex = HDF_SD_ATTRFIND(SDdataset_id, 'LOCATION')
; Retrieve attribute info:
HDF_SD_ATTRINFO,SDdataset_id, dindex, NAME=n, TYPE=t, COUNT=c,
DATA=d
; Print information about the new returned variables:
HELP, n, t, c, d
N STRING = 'TITLE' T STRING = 'STRING' C LONG = 17 D STRING = '5th Ave Surf Shop' H STRING = 'DFNT_CHAR88' N STRING = 'LOCATION' T STRING = 'STRING' C LONG = 15 D STRING = 'MELBOURNE BEACH'
Introduced: 4.0
HDF_SD_ATTRFIND, HDF_SD_ATTRSET, HDF_SD_CREATE, HDF_SD_SELECT, HDF_SD_START