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.
|