Added pixel shifting in ICgen

This commit is contained in:
Guilhem Lavaux 2014-06-04 09:13:34 +02:00
parent a82688b0b1
commit 7258dd20cb
4 changed files with 19 additions and 16 deletions

View file

@ -6,10 +6,11 @@ def fourier_analysis(borg_vol):
return np.fft.rfftn(borg_vol.density)*(L/N)**3, L, N
def half_pixel_shift(borg):
def half_pixel_shift(borg, doshift=False):
dhat,L,N = fourier_analysis(borg)
return dhat, L
if not doshift:
return dhat, L
ik = np.fft.fftfreq(N,d=L/N)*2*np.pi
phi = 0.5*L/N*(ik[:,None,None]+ik[None,:,None]+ik[None,None,:(N/2+1)])