HDF_SD_FILEINFO

The HDF_SD_FILEINFO procedure retrieves the number of datasets and global attributes in an HDF file.

Calling Sequence

HDF_SD_FILEINFO, SD_ID, Datasets, Attributes

Arguments

SD_ID

An SD interface ID as returned by HDF_SD_START.

Datasets

A named variable in which the total number of SD-type objects (i.e., the number of datasets + the number of dimensions) in the file is returned.

Attributes

A named variable in which the number of global attributes in the file is returned.

Example

sd_id = HDF_SD_START('demo.hdf', /CREATE)
; Start the SD interface.

HDF_SD_ATTRSET,sd_id, 'TITLE', 'MYTITLE'
; Set a global attribute.

HDF_SD_ATTRSET,sd_id, 'TITLE2', 'MYTITLE2'
; Set another one.

sds_id = HDF_SD_CREATE(sd_id, 'var1', [10,3])
; Create a dataset.

HDF_SD_FILEINFO, sd_id, datasets, attributes
; Retrieve info about the dataset.

HELP, datasets, attributes ; Print information about the returned variables.

IDL prints:

DATASETS LONG = 1

ATTRIBUTES LONG = 2

HDF_SD_ENDACCESS, sds_id ; End SD access.

HDF_SD_END, sd_id ; Close the SD interface.

See Also

HDF_SD_ATTRFIND , HDF_SD_ATTRINFO , HDF_SD_START