I am trying to mosaic several non-overlapping rasters together (they have same number of bands and same pixel sixe etc). I used the seamless mosaic tool in the envi gui and it worked great. When I tried to execute the ENVIMosaicRaster (https://www.harrisgeospatial.com/docs...) in IDL I got the error message "Mosaic raster input scenes are missing or invalid". During a different run I also got the error "ENVI::OPENRASTER: ENVI has not started."
Any help/insights would be greatly appreciated! I used the code:
PRO MOSAICBATCH2
COMPILE_OPT IDL2
; Start the application
e = ENVI(/HEADLESS)
; Select input scenes
files = FILE_SEARCH('/gpfs/data/mike/lindb/WNV/WELD/temp/summer/' + '*.tif', count=count)
print, count
scenes = !NULL
FOR i=0, N_ELEMENTS(files)-1 DO BEGIN
raster = e.OpenRaster(files[i])
scenes = [scenes, raster]
ENDFOR
; Create the mosaic raster
mosaicRaster = ENVIMosaicRaster(scenes)
; Save it as ENVI format
newFile = e.GetTemporaryFilename()
mosaicRaster.Export, newFile, 'ENVI'
; Close the ENVI session
e.Close
END
|