I have code for IDL to smooth hyperspectral data by utilizing a moving average. I need to add a function to tile the information, because I am currently limited to what memory my computer has available (which isn't much). Alternatively, are there any modules in ENVI that can average spectra, because I have used the spatial smoothing functions, but perhaps there is a way to apply this to the spectral data?
I've included my code below.
Thanks!
==============================================
xsz=400
ysz=400
zsz=354
factor=3
filename='D:\test\testfile'
q=fltarr(xsz,ysz,zsz)
openr,1,filename
readu,1,q
close,1
temp=fltarr(zsz)
for i=0,xsz-1 do begin
for j=0,ysz-1 do begin
temp(*)=q(i,j,*)
temp=smooth(temp,factor)
q(i,j,*)=temp
end ; for j
end ;for i
openw,2,filename+'_smth'
writeu,2,q
close,2
end
|