pro timpow1,mov,out ; A program to compute the time-changes power spectra at each ; spatial position of the movie and to output the mean power ; in 5 frequency channels. ; INPUT: movie MOV (3-D array) with spatial scale of about 0.5"/pix. ; OUTPUT: 3-D array OUT, where x- and y- dimensions are equal to those ; of MOV, and the z- dimension = 5, equal to the number of channels. ; Definition of channels ([begin,end] in pixels) ch=[[7,14],[15,23],[24,44],[45,66],[67,107]] ;--------------------------------------------- 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(1),si(2),5) ; 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. ; mean power in channels for c=0,4 do out(x,y,c)=mean(psp(ch(0,c):ch(1,c))) endfor print,si(2)-1-y endfor fin: end