comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » reading multiple HDF files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading multiple HDF files [message #61382 is a reply to message #61338] Wed, 16 July 2008 08:21 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
julia.walterspiel@gmail.com writes:

>
>> Did you try closing the file, as in my last suggestion?
>> This is pretty much what I expected without that close.
>>
>
>
> yes I did.
> I put the HDF_SD_END inside the loop and outside.
> Placing it outside gave me the 32-loops.
> Placing it inside gave me nothing but
> IDL> read_multiple_hdf
> Loaded DLM: HDF.
> Compiled module: HDF_SD_VARDIR.
>
> i'm sorry, this is my very first time I'm dealing with IDL, maybe I'm
> overlooking something completely obvious and simple?

Here is the code I used to test this. I can run as many as
I like with the HDF_SD_END in the code, but only 32 without
it. :-)

;########################################################### ##
PRO read_multiple_hdf

hdf_file_path='G:\data\96108_08.hdf'

;*********************************************************** *****
;********** Begin the for loop to read all selected hdf files ***

for I=0,100 do begin

hdfid = HDF_SD_START(hdf_file_path)
varnames = HDF_SD_VARLIST (hdfid)

index = hdf_sd_nametoindex(hdfid,'ScanRate')
if (index eq -1) then message, string(varnames)

varid = hdf_sd_select(hdfid, index)

HDF_SD_GETDATA, varid, data
hdf_sd_endaccess, varid
HDF_SD_END, hdfid

Print, I
endfor
END
;########################################################### #######
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: help about annotate
Next Topic: merge data-array with calender-date-array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:20:32 PDT 2025

Total time taken to generate the page: 0.87990 seconds