X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Sep 2010 04:46 AM by  anon
Bypass ENVI error dialogues
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Sep 2010 04:46 AM
    hi all, I have a program to process a number of satellite images. Every so often there is a faulty scene which throws up an ENVI error dialogue. However, the program cannot continue until the user clicks 'ok' on the dialogue box. is there any way to bipass the ENVI error dialogues? Alternatively i was thinking i could root out the problem files beforehand by listing files over a particular filesize (the faulty files are typically much smaller). Is there a way of returning a filesize without opening it up first? Any help is much appreciated. Andy

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Sep 2010 11:36 AM
    If you are running your code in ENVI batch mode (without the interactive ENVI menus open) then I wouldn't expect that you would be getting any ENVI dialogs popping up, waiting for your interaction. Of course, in that case, if your code encounters an error, then it will crash. The way to avoid that is to add error catching into your code. You can read a general description of how to do that in the IDL documentation under IDL Programmers' Guides > Application Programming > Part I: Application Programming > Debugging and Error-Handling > Controlling and Recovering from Errors. If you can anticipate the problem images by their size, then it makes sense to me that you check for that in your code before calling whatever routine is encountering errors on those files. You can check the file size with IDL routines, by first opening the file (for example, using OPEN), then using the SIZE keyword to the FSTAT routine. ENVI also has its own routine, ENVI_FILE_QUERY, that can return the dimensions of an image opened in ENVI. You would use the DIMS keyword to get the image dimensions. That's not exactly the same as the file size, but maybe it's enough to catch the problematic files before you actually try to read data from them. I hope this helps.
    You are not authorized to post a reply.