pro timpow2,mov,out ; A program to compute the time-changes power spectra at each ; spatial position of the movie and to output the average power ; spectrum over the whole area. ; INPUT: movie MOV (3-D array). ; OUTPUT: 1-D array OUT with the power spectrum. si=size(mov) if si(0) ne 3 then begin print,'This is not a 3-D array. STOPPED.' out=0 goto,fin endif out=fltarr(si(3)) ; apodization window u n=si(3) perc=5. ; percentage of array size to be damped np=nint(n*perc/100.) u=fltarr(n)+1. u(0)=0. for i=1,np do u(i)=(1.-cos(!pi*i/np))/2. u(n-np:n-1)=reverse(u(1:np)) ; loop over positions for y=0,si(2)-1 do begin for x=0,si(1)-1 do begin tt=mov(x,y,*) tt=tt-mean(tt) ; mean subtraction tt=tt*u ; apodization fo=fft(tt,-1) rfo=float(fo) ifo=imaginary(fo) psp=rfo*rfo+ifo*ifo ; power sp. out=out+psp ;accumulation endfor print,si(2)-1-y endfor out=out/(si(2)*si(1)) fin: end