Hello,
I'm new to IDL and I'm trying to run some band math equations on a lot of images. My script works for the first 100 images or so, but doesn't work on the rest. It says that the imagery must be a scalar or 1 element array in this context: . It seems that when I import the images into ENVI they display this ( fid = Long [2] ); while the other images displayed this ( fid = 2 ). Here is the script for an example image that does not work:
PRO Test
; Restore the core file and start ENVI in batch
ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT, LOG_FILE = 'batch.txt'
envi_open_file, 'H:\Total_2009\QB02_09DEC021431274-M1BS-101001000AB62600.ntf', r_fid=fid
if (fid eq -1) then begin
envi_batch_exit
return
endif
envi_file_query, fid, dims=dims
t_fid = [fid,fid]
pos = [1,2]
exp = '(b1*0.0143847/0.099)/10'
out_name = 'H:\Output_TOA\Green\1'
envi_doit, 'math_doit', $
fid=t_fid, pos=pos, dims=dims, $
exp=exp, out_name=out_name, $
r_fid=r_fid
END
I'm trying to figure out how to get rid of the fid = long(2) and have the value that match the other images that worked, but I'm a beginner to IDL and it taking me a very long time. I would very much appreciate some help with this matter, since I have to process 600 or more images!
Thanks
|