X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Nov 2011 01:17 PM by  anon
ENVI_FILE_MNG - not working?
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
01 Nov 2011 01:17 PM
    I am working on a memory-use intensive piece of code for various processing of Landsat tiles. I'm attempting to clean up after my file use in the code, to make room for further processing along the way. When I use ENVI_FILE_MNG (with the /REMOVE option) to close files, they remain in the 'Available Band List' of ENVI - and hence, take up precious memory (correct?). Is there something else I should be doing, to remove these files from memory? Thanks.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Nov 2011 01:26 PM
    ENVI_FILE_MNG appears to work for me (file removed from the ABL) with the /remove keyword. Since you are working with Landsat, it may be that you have not accessed the correct FID for removal if it is not removed from the ABL. When you open Landsat, you get several FIDs due to the way it is stored as a meta-file (separate TIFFs with a metadata file associating the various files). Perhaps you have not passed the correct FID to remove the file. Also, if you are trying to remove multiple FIDs, then you would need to loop through each FID to remove it.

    Deleted User



    New Member


    Posts:
    New Member


    --
    02 Nov 2011 07:42 PM
    Assuming you're opening and closing files in a loop, you might try getting a list of all open FID's with envi_get_file_ids() at the beginning of the loop. Then at the end of the loop, get a new list of FID's via another call to envi_get_file_ids(), then close any FID's that were in the new list but not in the old one.
    You are not authorized to post a reply.