利用 envi_layer_stacking_doit 实现波段融合。可考虑用面向对象的编程方式去重新编码(暂时复制以前的代码)。
compile_opt idl2
envi, /restore_base_save_files
start_path = 'F:\Temporary\data\LC8 Results\ENVI_clip\temp\ROI\'
cd,start_path
out_path = 'F:\Temporary\data\LC8 Results\ENVI_clip\temp\ROI\'
Files = FILE_Search(start_path + 'L*roi.tif', count = Filecount)
print, files
If FileCount Eq 0 Then Begin
print, 'File not exist'
Return
Endif
test_file = FILE_Search(out_path + '*Layer_stacking*', count = test_count)
if test_count ne 0 then begin
file_delete, out_path +"Layer_stacking"
file_delete, out_path +"Layer_stacking.hdr"
endif
nb = Filecount
fid = lonarr(nb)
pos = lonarr(nb)
dims = lonarr(5,nb)
out_bname = strarr(nb) ;为输出的每个波段命名
For i = 0, Filecount - 1 do begin
A_Name = Files[i]
envi_open_file