pro read_hdf, infile hdfid = HDF_SD_Start(infile, /read) HDF_SD_Fileinfo,hdfid, datasets, attributes ;help, datasets, attributes for j=0,attributes-1 do begin HDF_SD_AttrInfo, hdfid,j, Name=thisSDSname;, count=c print, 'Attribute No. ', StrTrim(j, 2), ': ', thisSDSname;, ', count = ', c endfor HDF_SD_AttrInfo, hdfid,0, Name=thisSDSname, count=c, data=attr0data HDF_SD_AttrInfo, hdfid,1, Name=thisSDSname, count=c, data=attr1data for j=0,datasets-1 do begin thisSDS = HDF_SD_Select(hdfid, j) HDF_SD_GetInfo, thisSDS, Name=thisSDSname print, 'Dataset No. ', StrTrim(j, 2), ': ', thisSDSname endfor HDF_SD_END, hdfid hdfid = HDF_open(infile) vgroups = hdf_vg_lone(hdfid) for i=0,n_elements(vgroups)-1 do begin vgid = hdf_vg_attach(hdfid,vgroups[i]) hdf_vg_getinfo,vgid,name=vname,nentries=nvg print, 'Vgroup No. ',i,' ',StrTrim(vname),nvg,' entries' spacer = ' ' read_vdata,hdfid,vgid,nvg,spacer hdf_vg_detach, vgid endfor HDF_Close, hdfid end pro read_vdata,hdfid,vgid,nvg,spacer vdid = -1 for i=0,nvg-1 do begin vdid = hdf_vg_getnext(vgid,vdid) if(HDF_VG_ISVD(vgid,vdid)) then begin vd_handle = hdf_vd_attach(hdfid,vdid) hdf_vd_get, vd_handle, name=vname, fields=vfields hdf_vd_detach,vd_handle print, spacer,'Entry No. ',i, '(index=',vdid,') is Vdata name=', vname,', contains ',vfields endif if(HDF_VG_ISVG(vgid,vdid)) then begin vgid2 = hdf_vg_attach(hdfid,vdid) hdf_vg_getinfo,vgid2,name=vname,nentries=nvg print, spacer,'Vgroup No. ',i,' ',StrTrim(vname),nvg,' entries' spacer = spacer+' ' read_vdata,hdfid,vgid2,nvg,spacer spacer = strmid(spacer,0,strlen(spacer)-1) hdf_vg_detach, vgid2 endif endfor end