pro read_sds_one,filename,tagname,f ; read one variable from the HDF file ; usage: idl> read_sds_one,'filename','parameter_1',variable_name ; chuntao liu ; 6/28/05 f=-1 tags=filename m=0 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) if(strupcase(na) eq strupcase(tagname)) then begin hdf_sd_getdata, sds_id, data f=data m=1 endif tags=[tags,na] hdf_sd_endaccess,sds_id endfor hdf_sd_end,sdsfileid if(m eq 0) then print,tagname,' not found in the file ',filename end