Re: reading multiple HDF files [message #61379 is a reply to message #61338] |
Wed, 16 July 2008 08:54   |
julia.walterspiel
Messages: 35 Registered: July 2008
|
Member |
|
|
yeah it was a different problem, a beginner problem.. sorry for
wasting your time folks! it works now:
############################################################ ####
PRO read_multiple_hdf
hdf_file_path=FILE_SEARCH('I:\zue\doc\ks\Temp_Satellite_Data \Temp_MODIS
\MOD_08_jointAerosolWaterVaporCloudProduct\*.hdf')
homer = intarr(6,2,99)
;*********************************************************** *****
;********** Begin the for loop to read all selected hdf files ***
for i=0,5 do begin
;for i=0,n_elements(hdf_file_path)-1 do begin
hdfid = HDF_SD_START(hdf_file_path(i), /READ)
varnames = HDF_SD_VARDIR (hdfid)
index = hdf_sd_nametoindex(hdfid,
'Cloud_Fraction_Mean_Mean') ;varnames[Cloud_Fraction_Mean_Mean])
if (index eq -1) then message, string(varnames, format='("Specified
Variable not found: ", a)')
varid = hdf_sd_select(hdfid, index)
HDF_SD_GETDATA, varid, data ;- The Cloud Fraction data will be
stored in the variable "data"
HDF_SD_ENDACCESS, varid
HDF_SD_END, hdfid
print, i
print, data
homer[*,*,i]= data[*,*]
endfor
END
####################################################
|
|
|