Commit 41b99d2c authored by rfetick's avatar rfetick
Browse files

minor modifications

parent 7df5aa50
......@@ -524,10 +524,10 @@ class ParametricPSFfromPSD(ParametricPSF):
otf = _np.exp(-Bphi)
if grad:
g2 = _np.zeros(g.shape,dtype=complex)
g2 = _np.zeros(g.shape,dtype=complex) # I cannot override 'g' here due to float to complex type
for i in range(len(x0)):
Bg = _fft.fft2(_fft.fftshift(g[i,...])) / L**2
# Warning: grad is normalized on the FoV, that is different of the otf!
# BUG: grad is normalized on the FoV, that is different of the otf!
Bphi = _fft.fftshift(_np.real(Bg[0, 0] - Bg)) # normalized on the numerical FoV
g2[i,...] = -Bphi*otf
return otf, g2
......@@ -646,6 +646,8 @@ class Turbulent(ParametricPSFfromPSD):
integral_out = 0.0229*6*_np.pi/5 * (r0*fmax)**(-5./3.) # analytical sum (outside the array's tangent circle)
integral = integral_in + integral_out
# TODO: I can also compute the integral gradient
if grad:
g = _np.zeros((len(x0),)+F2.shape)
g[0,...] = PSD*(-5./3)/r0
......@@ -763,6 +765,8 @@ class Psfao(ParametricPSFfromPSD):
# Remove central freq from all derivative
g[:,nx0,ny0] = 0
#TODO: I can also compute the integral gradient towards the parameters!
if grad: return PSD,integral,g
return PSD, integral
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment