You can typically only process one FID at a time so I would expect the result of a process within a FOR loop would return one FID. Then continue on processing each dataset within the loop and keep track of the returned FIDs. I am not sure what is expected of passing a variable that contains 3 FIDs.
As for TM_CAL_DOIT, the best way to troubleshoot is to do several print statements before and within the loop. I can't tell from the code snippets you posted if the variables are valid. I was able to process a TM5 multi-band scene using the following code:
PRO EXAMPLE_TMCAL_DOIT
COMPILE_OPT IDL2
IDL2
envi_select, fid=fid
envi_file_query, fid, dims=dims, nb=nb
pos=lindgen(nb)
bands_present = pos
lmin = [-1.52, -2.84, -1.170, -1.510, -0.370, -0.150]
lmax = [193., 365., 264., 221., 30.2, 16.5]
, fid=fid, fid, dims=dims, nb=nbpos=lindgen(nb)bands_present = poslmin = [-, -, -, -, -, -] lmax = [, , , , , ]
; Calculate the gain from lmin/lmax.
gain = fltarr(n_elements(lmin))
bias = lmin
for i=0, n_elements(lmin)-1 do begin
gain[i] = (lmax[i] - lmin[i]) / 255
endfor
i=, (lmin)- gain[i] = (lmax[i] - lmin[i]) /
date = [4,20,2008]
out_name = 'testimg'
sat = 1
envi_doit, 'tmcal_doit', $
fid=fid, pos=pos, dims=dims, $
bands_present=bands_present, $
sat=sat, cal_type=1, date=date, $
sun_angle=55.64, out_name=out_name, $
r_fid=r_fid, gain=gain, bias=bias
, 'tmcal_doit', $fid=fid, pos=pos, dims=dims, $bands_present=bands_present, $sat=sat, cal_type=, date=date, $sun_angle=, out_name=out_name, $r_fid=r_fid, gain=gain, bias=bias
END
|