FUNCTION FSHIFT,im0,xsh,ysh ;Fourier shift. Good for sub-pixel shifting: keeps power spectrum unchanged. ; NOTE: don't use on non-square or odd-sided images. ;Create AHB 08/01 ;Removed total flux normalization. Photometry now preserved, but note that ; negative values are cut off. AHB 03/04 if not KEYWORD_SET(int) then int = 0 sz = (SIZE(im0))(1) u = [FINDGEN(sz/2),FINDGEN(sz/2)-(sz/2)] v = [[FINDGEN(1,sz/2)],[FINDGEN(1,sz/2)-(sz/2)]] uu = REBIN(u,sz,sz) vv = REBIN(v,sz,sz) k = COMPLEX(0, (-2) * !pi * (uu*xsh + vv*ysh) / sz) ;im1 = ABS(FFT(FFT(im0) * EXP(k), /inverse)) im1 = FLOAT(FFT(FFT(im0) * EXP(k), /inverse)) RETURN,im1 END