pro fftpieces, old, new ; take the output of fft and put them the way they should be. ; must have an even number of elements in the array. sz = size(old) nx = sz(1) ny = sz(2) new = complexarr(nx,ny) bx = nx/2 by = ny/2 q1 = old(0:bx-1,0:by-1) q2 = old(0:bx-1,by:*) q3 = old(bx:*,0:by-1) q4 = old(bx:*,by:*) q1n = rotate(q1,2) q2n = rotate(q2,2) q3n = rotate(q3,2) q4n = rotate(q4,2) ; q1n = complexarr(bx,by) ; q2n = complexarr(bx,by) ; q3n = complexarr(bx,by) ; q4n = complexarr(bx,by) ; ; for ii=0,bx-1 do begin ; for jj=0,by-1 do begin ; q1n(ii,jj) = q1(bx-1-ii,by-1-jj) ; q2n(ii,jj) = q2(bx-1-ii,by-1-jj) ; q3n(ii,jj) = q3(bx-1-ii,by-1-jj) ; q4n(ii,jj) = q4(bx-1-ii,by-1-jj) ; endfor ; endfor new(0:bx-1,0:by-1) = q1n new(0:bx-1,by:*) = q2n new(bx:*,0:by-1) = q3n new(bx:*,by:*) = q4n return end