2

I have the following problem with the ENVI 5.0 API: I often use ENVI_DOIT batch routines in my scripts to generate intermediate images, leaving them in memory with the /IN_MEMORY switch. When I'm done with them I get rid of them with

ENVI_FILE_MNG, id=FID, /REMOVE.

Works great in ENVI 5.0 "Classic". The new ENVI 5.0 GUI, however, seems to feel obliged to place all images created in this way in "views", complete with building pyramids, and I get the warning

"The raster cannot be closed while processing the pyramid"

Consequently the intermediate files cannot be removed programmatically. I tried putting them on disk as temporary files, but the same error pops up when I try to delete the files from within the script. Is there any way to avoid this?

Bogdanovist
  • 1,498
  • 2
  • 11
  • 20
MortCanty
  • 317
  • 1
  • 2
  • 11

2 Answers2

1

I'm convinced that this is currently broken. I tried a number of things, including trying to manually trigger creation of the pyramid, testing that it existed, and then closing the raster, as in:

raster_file.createpyramid
print, raster_file.pyramid_exists ; prints '1'
raster_file.close

And I still get the error, "The raster cannot be closed while processing the pyramid."

I'm switching back to ENVI classic.

ohspite
  • 1,269
  • 1
  • 10
  • 18
  • Thanks for the confirmation. I dislike the new GUI intensely, and I'm sticking to ENVI Classic. But I wonder how long it will be supported. – MortCanty Dec 23 '12 at 11:50
0

This one works for me:

;pro closeall
fid=envi_get_file_ids()
if fid[0] ne -1 then begin
    for i=0, n_elements(fid)-1 do begin
        envi_file_mng, id=fid[i], /remove
    endfor
endif
;end

Sources:

  1. https://www.harrisgeospatial.com/Support/Forums/tabid/2342/aft/2798/
  2. http://ethangutmann.com/pages/idl/envilib.pro
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135