I am trying to do exactly what is outline below, but to no avail.
http://www.exelisvis.com/...ing-an-ENVITask.aspx
Here is my code, updated from the example above for use with 5.2:
pro batch_radiometric_calib
compile_opt idl2
e = envi(/headless)
task = ENVITask('RadiometricCalibration')
task.CALIBRATION_TYPE = 'top-of-atmosphere reflectance'
search_dir = '/users/ben/desktop/image'
filelist = file_search(search_dir + '*_mtl.txt')
outbase = '/users/ben/desktop/Rad'
foreach file, filelist, index do begin
raster = e.OpenRaster(file)
task.input_raster = raster
task.output_raster_uri = outbase + strtrim(index, 2)
task.Execute
endforeach
end
It fails at the 'raster = e.OpenRaster(file)' line with an 'unknown dataset' error.
Any suggestions would be most appreciated.