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

Home » Public Forums » archive » Reading sequence of HDF files fails after some number of successes
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 sequence of HDF files fails after some number of successes [message #82180 is a reply to message #82103] Wed, 21 November 2012 06:22 Go to previous messageGo to previous message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
I am not sure it it helps, but I think you can delete the first line with:
HDF_SD_ENDACCESS, varid & $

As long as you work on the same file it works like this as code below(I use it open MODIS albedo Level 3 product). This is how I processed over 1000 files.

Cheers, Klemen



FOR y=0,n-1 DO BEGIN
; Open EOS-HDF
i_fid = HDF_ISHDF(s_list[y])
IF i_fid EQ 0 THEN BEGIN
PRINT, ' !!! ' + s_list[y]
PRINT, 'The input file does not exist or is not HDF format!'
CONTINUE
ENDIF
sd_id = HDF_SD_START(s_list[y], /READ)
FOR i=0,6 DO BEGIN
out[i,*,*] = albedo_process_read_HDF(sd_id, 'Albedo_WSA_Band' + STRTRIM(i+1, 1), extent[*,t], sds_id=sds_id)
ENDFOR
HDF_SD_ENDACCESS, sds_id
HDF_SD_END, sd_id


Where the called function "albedo_process_read_HDF" is:

FUNCTION albedo_process_read_HDF, sd_id, sd_name, extent, sds_id=sds_id
sd_index = HDF_SD_NAMETOINDEX(sd_id, sd_name)
sds_id = HDF_SD_SELECT(sd_id, sd_index)
HDF_SD_GETDATA, sds_id, tmp, START=extent[0:1], COUNT=extent[2:3]
RETURN, tmp
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help with vert_colors and rgb_table
Next Topic: Help with SVDC procedure

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

Current Time: Fri Oct 10 12:43:47 PDT 2025

Total time taken to generate the page: 0.32328 seconds