Commit 933d1c00 authored by rfetick's avatar rfetick
Browse files

minor modif

parent e82b852d
...@@ -793,9 +793,11 @@ class Psfao(ParametricPSFfromPSD): ...@@ -793,9 +793,11 @@ class Psfao(ParametricPSFfromPSD):
moff = moffat(f2D,param,norm=Fao,removeInside=removeInside) moff = moffat(f2D,param,norm=Fao,removeInside=removeInside)
moff *= maskin moff *= maskin
# Warning: Numerical normalization! (not compatible with analytical gradient) numericalNorm = False # set to true in order to activate code below
if numericalNorm:
moff[nx0,ny0] = 0.0 # Set Moffat PSD = 0 at null frequency moff[nx0,ny0] = 0.0 # Set Moffat PSD = 0 at null frequency
#moff = moff / (_np.sum(moff)*pix**2) # normalize moffat numerically to get correct A=sigma² in the AO zone moff = moff / (_np.sum(moff)*pix**2) # normalize moffat numerically to get correct A=sigma² in the AO zone
if grad: raise ValueError("PSFAO analytical gradient computation is not compatible with numerical Moffat normalization")
# Warning: Moffat numerical normalization generates strehlOTF jump when "_k" is changed # Warning: Moffat numerical normalization generates strehlOTF jump when "_k" is changed
PSD += maskin * (C + A*moff) # before I wrote "moffat(f2D,param,norm=Fao)" instead of "moff", so no numerical normalization PSD += maskin * (C + A*moff) # before I wrote "moffat(f2D,param,norm=Fao)" instead of "moff", so no numerical normalization
...@@ -807,7 +809,6 @@ class Psfao(ParametricPSFfromPSD): ...@@ -807,7 +809,6 @@ class Psfao(ParametricPSFfromPSD):
integral_out = 0.0229*6*_np.pi/5 * (r0*fmax)**(-5./3.) # analytical sum integral_out = 0.0229*6*_np.pi/5 * (r0*fmax)**(-5./3.) # analytical sum
integral = integral_in + integral_out integral = integral_in + integral_out
# TODO: finish gradient computation!
if grad: if grad:
g = _np.zeros((len(x0),)+F2.shape) g = _np.zeros((len(x0),)+F2.shape)
# derivative towards r0 # derivative towards r0
......
Supports Markdown
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