;+ ; NAME: ; HDFAttribs ; ; PURPOSE: ; Lists all the SDSs and attributes within an HDF file ; ; AUTHOR: ; Alex Fraser (Pieced together from reading "IDL Programming" by David Fanning) ; ; CATEGORY: ; HDF Utility ; ; CALLING SEQUENCE: ; see example ; ; INPUTS: ; no command line inputs - all is done via dialog_pickfile() ; ; KEYWORDS: ; none ; ; OUTPUTS: ; lists to the IDL output window all the HDF file's SDSs and attributes ; ; RESTRICTIONS: ; none ; ; EXAMPLE: ; HDFAttribs ; ; MODIFICATION HISTORY: ; ; Written by Alex Fraser, 2007. ;- PRO HDFAttribs filename=dialog_pickfile() sdfileid=hdf_sd_start(filename, /read) hdf_sd_fileinfo, sdfileid, datasets, attributes FOR j=0, datasets-1 DO BEGIN thissdsid=HDF_SD_SELECT(sdfileid, j) HDF_SD_GETINFO, thissdsid, name=thisSDSname, natts=numattributes print, 'Dataset No. ', strtrim(j,2), ': ', thisSDSname for k=0, numattributes-1 DO BEGIN hdf_sd_attrinfo, thissdsid, k, name=thisattr print, ' SDS Attribute No. ', +strtrim(k,2), ': ', thisattr ENDFOR ENDFOR HDF_SD_END, sdfileid END