pro show_sds,filename,tags=tags ; show variables from HDF files ; usage: idl> read_sds_one,'filename',tags=tags ; return the tags with the names of the variables ; chuntao liu ; 6/28/05 m=0 tags=filename sdsfileid = hdf_sd_start(filename,/read) hdf_sd_fileinfo,sdsfileid,numsds,ngatt for i = 0, numsds - 1 do begin sds_id = hdf_sd_select(sdsfileid, i ) hdf_sd_getinfo, sds_id, name = na, ndim = nd,type= typ, label=label if keyword_set(tag_label) and strlen(label) gt 0 then na=label tics=strsplit(na,' ',/extract) if(n_elements(tics) gt 1) then na=tics[0]+'_'+stringit(long(tics[1])) iftags=where(strupcase(na) eq tags) if(iftags[0] ge 0) then na=na+'_'+stringit(i) print,na,typ,nd,format='(a30,a10,i3)' tags=[tags,na] hdf_sd_endaccess,sds_id endfor hdf_sd_end,sdsfileid end