Commit 18d1a38b authored by rfetick's avatar rfetick
Browse files

Rename 'ellip' to 'ratio'

parent 459b402f
......@@ -27,11 +27,11 @@ r0 = 0.15 # Fried parameter [m]
bck = 1e-5 # Phase PSD background [rad² m²]
amp = 5.0 # Phase PSD Moffat amplitude [rad²]
alpha = 0.1 # Phase PSD Moffat alpha [1/m]
ellip = 1.2
ratio = 1.2
theta = np.pi/4
beta = 1.6 # Phase PSD Moffat beta power law
param = [r0,bck,amp,alpha,ellip,theta,beta]
param = [r0,bck,amp,alpha,ratio,theta,beta]
psf = Pmodel(param,dx=0,dy=0)
......
......@@ -36,11 +36,11 @@ r0 = 0.15 # Fried parameter [m]
b = 1e-7 # Phase PSD background [rad² m²]
amp = 1.4 # Phase PSD Moffat amplitude [rad²]
alpha = 0.1 # Phase PSD Moffat alpha [1/m]
ellip = 1.0
ratio = 1.0
theta = 0.0
beta = 1.6 # Phase PSD Moffat beta power law
param = [r0,b,amp,alpha,ellip,theta,beta]
param = [r0,b,amp,alpha,ratio,theta,beta]
psf = Pmodel(param,dx=0,dy=0)
......@@ -48,7 +48,7 @@ noise = ron*np.random.randn(npix,npix)
image = flux*psf + bckgd + noise
#%% Fit the PSF with Psfao
guess = [0.145,2e-7,1.2,0.08,ellip,theta,1.5]
guess = [0.145,2e-7,1.2,0.08,ratio,theta,1.5]
w = np.ones_like(image)/ron**2.0
fixed = [False,False,False,False,True,True,False]
......
......@@ -44,11 +44,11 @@ r0 = 0.15 # Fried parameter [m]
b = 1e-7 # Phase PSD background [rad² m²]
amp = 1.4 # Phase PSD Moffat amplitude [rad²]
alpha = 0.1 # Phase PSD Moffat alpha [1/m]
ellip = 1.0 # Phase PSD Moffat ellipticity
ratio = 1.0 # Phase PSD Moffat ellipticity
theta = 0.0 # Phase PSD Moffat angle
beta = 1.6 # Phase PSD Moffat beta power law
param = [r0,b,amp,alpha,ellip,theta,beta]
param = [r0,b,amp,alpha,ratio,theta,beta]
psf = Pmodel(param,dx=0,dy=0)
......@@ -61,7 +61,7 @@ im_crop = image[npix//2-ncrop//2:npix//2+ncrop//2,
npix//2-ncrop//2:npix//2+ncrop//2]
#%% Fit the cropped image with Psfao
guess = [0.145,2e-7,1.2,0.08,ellip,theta,1.5]
guess = [0.145,2e-7,1.2,0.08,ratio,theta,1.5]
w = np.ones_like(im_crop)/ron**2.0
fixed = [False,False,False,False,True,True,False]
......
......@@ -26,7 +26,7 @@ r0 = 0.18 # Fried parameter [m]
moff_C = 1e-2 # PSD constant [rad²m²]
moff_A = 2. # PSD Moffat variance [rad²]
moff_alpha = 5e-2 # PSD Moffat alpha_x [1/m]
moff_ellip = 1.0 # PSD Moffat ellipticity
moff_ratio = 1.0 # PSD Moffat ellipticity
moff_theta = 0. # PSF major axis rotation [rad]
moff_beta = 1.6 # PSD Moffat beta power law
......@@ -41,7 +41,7 @@ psf = imcenter(psf, (Npix, Npix), maxi=True) * ZIMPOL.gain
wvl = filt[0]
samp = ZIMPOL.samp(wvl)
x0 = [r0,moff_C,moff_A,moff_alpha,moff_ellip,moff_theta,moff_beta]
x0 = [r0,moff_C,moff_A,moff_alpha,moff_ratio,moff_theta,moff_beta]
fixed = [False,False,False,False,True,True,False]
weights = np.ones_like(psf)
......
......@@ -437,7 +437,7 @@ class Psfao(ParametricPSF):
self.system = system
self.Lext = Lext
self.samp = samp
# r0,C,A,alpha,ellip,theta,beta
# r0,C,A,alpha,ratio,theta,beta
bounds_down = [_EPSILON,0,0,_EPSILON,_EPSILON,-np.inf,1+_EPSILON]
bounds_up = [np.inf for i in range(7)]
self.bounds = (bounds_down,bounds_up)
......@@ -489,13 +489,13 @@ class Psfao(ParametricPSF):
Fao = self.system.Nact/(2.0*self.system.D)
r0,C,A,alpha,ellip,theta,beta = x0
r0,C,A,alpha,ratio,theta,beta = x0
PSD = 0.0229* r0**(-5./3.) * ((1. / self.Lext**2.) + F2)**(-11./6.)
PSD *= (F2 >= Fao**2.)
ax = alpha*ellip
ay = alpha/ellip
ax = alpha*ratio
ay = alpha/ratio
param = (ax,ay,theta,beta,0,0)
PSD += (F2 < Fao**2.) * np.abs(C + A*moffat(f2D,param,norm=Fao))
# Set PSD = 0 at null frequency
......@@ -556,7 +556,7 @@ class Psfao(ParametricPSF):
x[1] - PSD corrected area background C [rad² m²]
x[2] - PSD corrected area phase variance A [rad²]
x[3] - PSD alpha [1/m]
x[4] - PSD ellipticity
x[4] - PSD ax/ay ratio
x[5] - PSD theta [rad]
x[6] - PSD beta power law
dx : float
......@@ -575,12 +575,12 @@ class Psfao(ParametricPSF):
def tofits(self,param,filename,*args,keys=None,**kwargs):
if keys is None:
keys = ["R0","CST","SIGMA2","ALPHA","ELLIP","THETA","BETA"]
keys = ["R0","CST","SIGMA2","ALPHA","RATIO","THETA","BETA"]
keys_comment = ["Fried parameter [m]",
"PSD AO area constant C [rad2]",
"PSD AO area Moffat variance A [rad2]",
"PSD AO area Moffat alpha [1/m]",
"PSD AO area Moffat ellipticity",
"PSD AO area Moffat ax/ay ratio",
"PSD AO area Moffat theta [rad]",
"PSD AO area Moffat beta"]
......
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