;*************************************************
;	Cross-Correlation with FFT Method
;*************************************************

pro acpole,a1,a2,shx,shy

si=size(a1)
nx=si(1)
ny=si(2)
a11=fft(fft(a1,1)*conj(fft(a2,1)),-1)
a12=abs(a11*conj(a11))

 	
	fmax=max(a12,i)
	shx=i mod nx
	shy=i/nx
	if(shx gt nx/2) then shx=shx-nx
	if(shy gt ny/2) then shy=shy-ny
print,'correlation position:  ',shx,shy,fmax
end
