When using MATH_DOIT on multiple bands for multiple band output, you have to loop through each band. The result will be several separate bands so then you can put them back together using something like CF_DOIT. An example might be:
for i=0,num_bands-1 do begin
envi_doit, 'math_doit', dims=dims, exp=expression, pos=pos[i], $
fid=input_fid, out_name=out_name, r_fid=r_fid, /in_memory
out_fid[i]=r_fid
endfor
pos=lonarr(num_bands)
envi_doit, 'cf_doit', dims=dims, fid=out_fid, pos=pos, out_dt=2, $
out_name=out_name, /remove, r_fid=result_fid
|