I have a series of bandmath processes that need to be run via envi and that I am doing over and over again. I have no experience with IDL but am trying to automate using it. I want to be able to choose input files via dialog box, or even just be able to pass the result of a bandmath process to the next process. I am able to do this automation using python and arc but don't seem to get the correct results, hence IDL and ENVI.
IDL documentation seems to indicate that that in IDL the bands need to be in the same raster whereas in ENVI I never need to do that. Is this the case? Am I missing a step to get my code to work?
Barring specifics, are there better tutorials out there than what's available in the code documentation?
; Start ENVI e = ENVI() ; Open a data file File1 = DIALOG_PICKFILE(/READ) Raster1 = e.OpenRaster(File1) ; Determine an output file OutFile1 = e.GetTemporaryFilename() File2 = DIALOG_PICKFILE(/READ) Raster2 = e.OpenRaster(File2) Outfile2 = e.GetTemporaryFilename() ; Return a file ID fid = ENVIRasterToFID(Raster1) Outfile3 = e.GetTemporaryFilename() ; Add the first two bands ENVI_File_Query, fid, DIMS=dims ENVI_Doit, 'Math_Doit', $ FID = [fid, fid], $ DIMS = dims, $ POS = [0,1], $ EXP = 'b1 + b2', $ OUT_NAME = Outfile3 END