; +;:D Escription:; Describe the procedure.; Author:dyq 2009-7-19;;; -pro TEST_READHDF compile_opt idl2 file = File_dirname (Routine_filepath (' TEST_READHDF ')) + $ ' \data\mod04_l2. A2004196.0140.005.2007023163311.HDF '; ISHDF = HDF_ISHDF (file) IF ishdf EQ 0 then RETURN; ; Call IDL's own function to obtain information of current HDF data; Hdf_info,file; If we need to do a geo-corrective operation, we need to obtain the original data, and the latitude data grid, data acquisition two ways, through the SD information in the name index to judge, such as latitude data representation latitude; open hdfsd file; sd_id = Hdf_sd_start (file,/read) hdf_sd_fileinfo,sd_id,nmfsds,attr for i=0,nmfsds-1 do BEGIN Sds_id=hdf_sd_sele CT (sd_id,i); the name of the data set in the dataset hdf_sd_getinfo,sds_id,name=n,ndims=r,type=t,natts=nats,$ hdf_type=h,unit=u IF n EQ ' L Atitude ' then BEGIN hdf_sd_getdata,sds_id,latdata break ENDIF endfor; custom read; Calculate the index of Latitude in SD Latindex = Hdf_sd_nametoindex (sd_id, ' Latitude '); Gets the ID of the index where Result = Hdf_sd_select (sd_id, Latindex); Read data Hdf_sd_getdata, result, templatdata; see if the read results are consistent help,array_equal (latdata,templatdata) END;;
"171" IDL read HDF file