Hi Guys,
I'm trying to to a forward mnf from previous noise statistics within IDL.
See the code below. The resulting image is not right, as in I do not get the same result as when I do it through the GUI using the previous noise statistics option. If you know how to do it with the new ENVI api that would we great too.
pro pca
ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT, LOG_FILE='batch.txt'
flist=FILE_SEARCH('*image.img', COUNT=count)
FOR h=0, count-1 Do Begin
envi_open_file, flist[h], r_fid=fid
ENVI_FILE_QUERY,fid, dims=dims, nb=nb
pos = lindgen(nb)
out_name='idlmnf1.img'
ENVI_DOIT, 'ENVI_STATS_DOIT', $
FID = fid, POS = pos, DIMS = dims, $
MEAN = avg, EVAL = eval, EVEC = evec, $
COMP_FLAG = 5
; this is how PCA does it
;;
;ENVI_DOIT, 'PC_ROTATE', $
; FID = fid, POS = pos, DIMS = dims, $
; MEAN = avg, EVAL = eval, EVEC = evec, $
; OUT_DT = 4, OUT_NAME = out_name, $
; OUT_NB = nb, R_FID = r_fid, $
; /FORWARD, /NO_PLOT
nsta='nsta'
sta='stamnfidltest'
; I don't think I have done this right here, but the code runs
ENVI_DOIT, 'MNF_DOIT', DIMS=dims, FID=fid, NOISE_EVAL=eval, $
NOISE_EVEC=evec, $
NOISE_STA_NAME=nsta, OUT_NAME=out_name, POS=pos, $
R_FID=rfid, STA_NAME=sta, in_memory=0, shift_diff=0, sd_dims=dims
endfor
end
|