Commit d07d891d authored by Daniel Brown's avatar Daniel Brown
Browse files

Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat

parents 6e71adba daae3ce9
Pipeline #616 skipped
...@@ -117,7 +117,7 @@ def pd_phase(tmpkat): ...@@ -117,7 +117,7 @@ def pd_phase(tmpkat):
# function for root finding # function for root finding
def PD_q_test(x): def PD_q_test(x):
kat.PDrefl_q.phase1=float(x) kat.PDrefl_q.phase1=x
out = kat.run() out = kat.run()
print('\r root finding: function value {0:<16g}'.format(float(out.y)), end='') print('\r root finding: function value {0:<16g}'.format(float(out.y)), end='')
sys.stdout.flush() sys.stdout.flush()
...@@ -180,7 +180,7 @@ def resonance(tmpkat): ...@@ -180,7 +180,7 @@ def resonance(tmpkat):
# function for root finding # function for root finding
def carrier_resonance(x): def carrier_resonance(x):
kat.ETM.phi=float(x) kat.ETM.phi=x
out = kat.run() out = kat.run()
phase = (out.y[0,0]-out.y[0,1]-90)%360-180.0 phase = (out.y[0,0]-out.y[0,1]-90)%360-180.0
print('\r root finding: function value {0:<16g}'.format(float(phase)), end='') print('\r root finding: function value {0:<16g}'.format(float(phase)), end='')
......
...@@ -178,7 +178,7 @@ def asc_phases(tmpkat): ...@@ -178,7 +178,7 @@ def asc_phases(tmpkat):
kat.maxtem=1 kat.maxtem=1
def demod_phase1(x): def demod_phase1(x):
kat.WFS1_I.phase1=float(x[0]) kat.WFS1_I.phase1=x[0]
out = kat.run() out = kat.run()
signal = out["WFS1_I"] signal = out["WFS1_I"]
print('\r minimising: function value {0:<16g}'.format(float(signal)), end='') print('\r minimising: function value {0:<16g}'.format(float(signal)), end='')
...@@ -186,7 +186,7 @@ def asc_phases(tmpkat): ...@@ -186,7 +186,7 @@ def asc_phases(tmpkat):
return -1*abs(signal) return -1*abs(signal)
def demod_phase2(x): def demod_phase2(x):
kat.WFS2_I.phase1=float(x[0]) kat.WFS2_I.phase1=x[0]
out = kat.run() out = kat.run()
signal = out["WFS2_I"] signal = out["WFS2_I"]
print('\r minimising: function value {0:<16g}'.format(float(signal)), end='') print('\r minimising: function value {0:<16g}'.format(float(signal)), end='')
...@@ -196,14 +196,14 @@ def asc_phases(tmpkat): ...@@ -196,14 +196,14 @@ def asc_phases(tmpkat):
kat.ITM.ybeta=1e-10 kat.ITM.ybeta=1e-10
kat.ETM.ybeta=0.0 kat.ETM.ybeta=0.0
res = fmin(demod_phase1, [0.0], xtol=1e-8, disp=False) res = fmin(demod_phase1, [0.0], xtol=1e-8, disp=False)
WFS1_phase = float(res[0]) WFS1_phase = res[0]
print("") print("")
print(" WFS1 demod phase : %.10g deg" % WFS1_phase) print(" WFS1 demod phase : %.10g deg" % WFS1_phase)
kat.ITM.ybeta=0.0 kat.ITM.ybeta=0.0
kat.ETM.ybeta=-1e-10 kat.ETM.ybeta=-1e-10
res = fmin(demod_phase2, [0.0], xtol=1e-8, disp=False) res = fmin(demod_phase2, [0.0], xtol=1e-8, disp=False)
WFS2_phase = float(res[0]) WFS2_phase = res[0]
print("") print("")
print(" WFS2 demod phase : %.10g deg" % WFS2_phase) print(" WFS2 demod phase : %.10g deg" % WFS2_phase)
return(WFS1_phase, WFS2_phase) return(WFS1_phase, WFS2_phase)
......
...@@ -16,10 +16,10 @@ import copy ...@@ -16,10 +16,10 @@ import copy
import sys import sys
def set_thermal_lens(kat, f): def set_thermal_lens(kat, f):
kat.ITM_TL.f=float(f) kat.ITM_TL.f=f
# if a bs-based cavity is used, we need to set second lens # if a bs-based cavity is used, we need to set second lens
if "ITM_TL_r" in kat._kat__components: if "ITM_TL_r" in kat._kat__components:
kat.ITM_TL_r.f=float(f) kat.ITM_TL_r.f=f
return (kat) return (kat)
def main(): def main():
...@@ -91,14 +91,14 @@ def main(): ...@@ -91,14 +91,14 @@ def main():
x1=0.70 x1=0.70
x2=0.30 x2=0.30
if "ITM_TL_r" in kat._kat__components: if "ITM_TL_r" in kat._kat__components:
beam50 = beam_param(z=float(x1*beam1[1].z+x2*beam2[1].z), w0=float(x1*beam1[1].w0+x2*beam2[1].w0)) beam50 = beam_param(z=(x1*beam1[1].z+x2*beam2[1].z), w0=(x1*beam1[1].w0+x2*beam2[1].w0))
beam5 = beam_param(z=float(x1*beam1[1].z+x2*beam3[1].z), w0=float(x1*beam1[1].w0+x2*beam3[1].w0)) beam5 = beam_param(z=(x1*beam1[1].z+x2*beam3[1].z), w0=(x1*beam1[1].w0+x2*beam3[1].w0))
node_text = "at ITM->nITM1r" node_text = "at ITM->nITM1r"
t_comp=kat.ITM t_comp=kat.ITM
t_node=kat.ITM.nITM1r t_node=kat.ITM.nITM1r
else: else:
beam50 = beam_param(z=float(x1*beam1[4].z+x2*beam2[4].z), w0=float(x1*beam1[4].w0+x2*beam2[4].w0)) beam50 = beam_param(z=(x1*beam1[4].z+x2*beam2[4].z), w0=(x1*beam1[4].w0+x2*beam2[4].w0))
beam5 = beam_param(z=float(x1*beam1[4].z+x2*beam3[4].z), w0=float(x1*beam1[4].w0+x2*beam3[4].w0)) beam5 = beam_param(z=(x1*beam1[4].z+x2*beam3[4].z), w0=(x1*beam1[4].w0+x2*beam3[4].w0))
node_text = "at s2->npo2" node_text = "at s2->npo2"
t_comp=kat.s2 t_comp=kat.s2
t_node=kat.s2.npo2 t_node=kat.s2.npo2
......
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