Hi,
I want to sharpen a series of images in batch mode IDL and I use the following commands:
hrv = e.OpenRaster(curfile)
fid_hrv = ENVIRasterToFID(hrv)
rgb = e.OpenRaster(rgbfile)
fid_rgb = ENVIRasterToFID(rgb)
envi_file_query, fid_hrv, dims=dims
ENVI_DOIT, 'SHARPEN_DOIT', F_DIMS=dims, F_FID=fid_hrv, F_POS=lindgen(1), FID=fid_rgb, INTERP=2,METHOD=0, pos=lindgen(3), R_FID=fid_sha,/in_memory
hires = ENVIFIDToRaster(fid_sha)
e.ExportRaster, hires, outfile, 'TIFF'
curfile, rgbfile and outfile are all correct and fid_hrv + fid_rgb show valid values. However, the script fails on the line that I have bolded with an error stating that fid_sha is incorrect (it has a value of -1). I have tried both the HSV sharpening and GS sharpening and get the same result.
Any ideas what is wrong here? The input files are byte format are not georeferenced*. Both HSV and GS work correctly through the ENVI GUI, but not in this batch script.
*Indeed, can't be georeferenced, envi doesn't support GEOS projection. This does not affect the GUI processing.
-edited-
Also, in case it's useful: Stepping through each line of code (even though I can't see them) within envi_doit shows that something returns error status -162. The system->!error_state->msg variable contains:
"Attempt to subscript FID with is out of range"
|