Re: reading multiple HDF files [message #61393 is a reply to message #61338] |
Wed, 16 July 2008 06:27   |
julia.walterspiel
Messages: 35 Registered: July 2008
|
Member |
|
|
well, it works, it doesnt, then it does, then it doesnt..
???????
here's the small code, if one of you could look at it quickly? I'm
pretty sure, the error will strike you immediatley. However, it
doesn't strike ME.
PRO read_multiple_hdf
hdf_file_path=FILE_SEARCH('I:\zue\doc\ks\Temp_Satellite_Data \Temp_MODIS
\MOD_08_jointAerosolWaterVaporCloudProduct\*.hdf')
;*********************************************************** *****
;********** Begin the for loop to read all selected hdf files ***
for i=0,n_elements(hdf_file_path)-1 do begin
hdfid = HDF_SD_START(hdf_file_path(i))
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
; *********** get the filename only, without path
filename_short = file_basename(hdf_file_path[i])
; to be continued....
endfor
END
|
|
|