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

Home » Public Forums » archive » HDF_SD_START: Invalid HDF file or filename: problem related to network issues
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
HDF_SD_START: Invalid HDF file or filename: problem related to network issues [message #86278] Tue, 22 October 2013 11:06 Go to next message
Robert Levy is currently offline  Robert Levy
Messages: 1
Registered: October 2013
Junior Member
Hi all,
I am a group newbie, so i apologize if a solution exists but I didn't find.

Anyway, I am running a giant script to read thousands of MODIS HDF data files, which the files are located on a LVES mount (data are virtually mounted through a network).

So the problem seems to be that there are occasional network "blips" that happen. For example, I run these command:

1) determine that the file exists and is a proper HDF file
fileHandle = HDF_OPEN(Filename, /READ )
IF fileHandle LT 1 THEN BEGIN
errorLevel = 1
Return, errorLevel
ENDIF
HDF_CLOSE, fileHandle


2) Then I go and actually open the file:

hdfid = HDF_SD_START(Filename, /READ)


This is where the code bombs and gives me:
HDF_SD_START: Invalid HDF file or filename

and stops my whole code. This file exists and is a perfectly fine file.


Note that this may happen after the code is running for days (opening and closing files). If I try a second later, it works fine. Is there any way to have HDF_SD_START exit gracefully, and return an error code, rather than stop with error message? Then I could know it is a network problem and try again a few seconds later.

Thanks for any ideas.

-Rob
Re: HDF_SD_START: Invalid HDF file or filename: problem related to network issues [message #86280 is a reply to message #86278] Tue, 22 October 2013 11:37 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Hi Rob :)

This has happened to me a lot so I'm also interested if there's a solution... I normally manually copy-paste the line the code failed on, and then type .continue after to resume it. It works, but requires manual intervention.

Andy

On Tuesday, October 22, 2013 2:06:50 PM UTC-4, Robert Levy wrote:
> Hi all,
>
> I am a group newbie, so i apologize if a solution exists but I didn't find.
>
>
>
> Anyway, I am running a giant script to read thousands of MODIS HDF data files, which the files are located on a LVES mount (data are virtually mounted through a network).
>
>
>
> So the problem seems to be that there are occasional network "blips" that happen. For example, I run these command:
>
>
>
> 1) determine that the file exists and is a proper HDF file
>
> fileHandle = HDF_OPEN(Filename, /READ )
>
> IF fileHandle LT 1 THEN BEGIN
>
> errorLevel = 1
>
> Return, errorLevel
>
> ENDIF
>
> HDF_CLOSE, fileHandle
>
>
>
>
>
> 2) Then I go and actually open the file:
>
>
>
> hdfid = HDF_SD_START(Filename, /READ)
>
>
>
>
>
> This is where the code bombs and gives me:
>
> HDF_SD_START: Invalid HDF file or filename
>
>
>
> and stops my whole code. This file exists and is a perfectly fine file.
>
>
>
>
>
> Note that this may happen after the code is running for days (opening and closing files). If I try a second later, it works fine. Is there any way to have HDF_SD_START exit gracefully, and return an error code, rather than stop with error message? Then I could know it is a network problem and try again a few seconds later.
>
>
>
> Thanks for any ideas.
>
>
>
> -Rob
Re: HDF_SD_START: Invalid HDF file or filename: problem related to network issues [message #86281 is a reply to message #86278] Tue, 22 October 2013 11:44 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Robert Levy writes:

>
> Hi all,
> I am a group newbie, so i apologize if a solution exists but I didn't find.
>
> Anyway, I am running a giant script to read thousands of MODIS HDF data files, which the files are located on a LVES mount (data are virtually mounted through a network).
>
> So the problem seems to be that there are occasional network "blips" that happen. For example, I run these command:
>
> 1) determine that the file exists and is a proper HDF file
> fileHandle = HDF_OPEN(Filename, /READ )
> IF fileHandle LT 1 THEN BEGIN
> errorLevel = 1
> Return, errorLevel
> ENDIF
> HDF_CLOSE, fileHandle
>
>
> 2) Then I go and actually open the file:
>
> hdfid = HDF_SD_START(Filename, /READ)
>
>
> This is where the code bombs and gives me:
> HDF_SD_START: Invalid HDF file or filename
>
> and stops my whole code. This file exists and is a perfectly fine file.
>
>
> Note that this may happen after the code is running for days (opening and closing files). If I try a second later, it works fine. Is there any way to have HDF_SD_START exit gracefully, and return an error code, rather than stop with error message? Then I could know it is a network problem and try again a few seconds later.
>
> Thanks for any ideas.

Well, CATCH error handlers are always pretty useful. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: HDF_SD_START: Invalid HDF file or filename: problem related to network issues [message #86285 is a reply to message #86281] Wed, 23 October 2013 02:05 Go to previous messageGo to next message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
On 22/10/13 20:44, David Fanning wrote:
>> Thanks for any ideas.
>
> Well, CATCH error handlers are always pretty useful. :-)

I would add that you should WAIT a few seconds between retries, and maybe also
limit the number of retries to a few hundreds.


chl
Re: HDF_SD_START: Invalid HDF file or filename: problem related to network issues [message #92603 is a reply to message #86278] Wed, 20 January 2016 13:33 Go to previous message
xin.xi30 is currently offline  xin.xi30
Messages: 1
Registered: January 2016
Junior Member
On Tuesday, October 22, 2013 at 11:06:50 AM UTC-7, Robert Levy wrote:
> Hi all,
> I am a group newbie, so i apologize if a solution exists but I didn't find.
>
> Anyway, I am running a giant script to read thousands of MODIS HDF data files, which the files are located on a LVES mount (data are virtually mounted through a network).
>
> So the problem seems to be that there are occasional network "blips" that happen. For example, I run these command:
>
> 1) determine that the file exists and is a proper HDF file
> fileHandle = HDF_OPEN(Filename, /READ )
> IF fileHandle LT 1 THEN BEGIN
> errorLevel = 1
> Return, errorLevel
> ENDIF
> HDF_CLOSE, fileHandle
>
>
> 2) Then I go and actually open the file:
>
> hdfid = HDF_SD_START(Filename, /READ)
>
>
> This is where the code bombs and gives me:
> HDF_SD_START: Invalid HDF file or filename
>
> and stops my whole code. This file exists and is a perfectly fine file.
>
>
> Note that this may happen after the code is running for days (opening and closing files). If I try a second later, it works fine. Is there any way to have HDF_SD_START exit gracefully, and return an error code, rather than stop with error message? Then I could know it is a network problem and try again a few seconds later.
>
> Thanks for any ideas.
>
> -Rob


Hi Rob,
Have you found a solution to your problem? I am having the same issue. The MODIS collection 6 MYD04 file I want to read is valid, but hdf_open reports -1 fileHandle, and hdf_sd_start reports invalid HDF file or filename.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 8 byte to double?
Next Topic: Interesting results when using IMAGE function

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

Current Time: Wed Oct 08 09:15:52 PDT 2025

Total time taken to generate the page: 0.00760 seconds