diff --git a/examples/asc_test/asc_pd_phase.py b/examples/asc_test/asc_pd_phase.py deleted file mode 100644 index 53ae0ec5b20486d50271cc8dd3e620c2c7d01a4d..0000000000000000000000000000000000000000 --- a/examples/asc_test/asc_pd_phase.py +++ /dev/null @@ -1,44 +0,0 @@ -import copy -import sys -import scipy.optimize - -from pykat import finesse - -def run(tmpkat): - - kat = copy.deepcopy(tmpkat) - - code_det = """ - pd1 PDrefl_q 9M 90 nWFS1 - %scale 2 PDrefl_q - """ - - kat.parseKatCode(code_det) - kat.noxaxis= True - - # function for root finding - def PD_q_test(x): - kat.PDrefl_q.phi[0]=x - out = kat.run(printout=0,printerr=0) - print '\r root finding: function value %g ' % out.y, - sys.stdout.flush() - return out.y - - # do root finding - xtol=1e-8 - (result, info)=scipy.optimize.bisect(PD_q_test,80.0,100.0, xtol=xtol, maxiter=500, full_output=True) - - print "" - if info.converged: - p_phase=result-90.0 - q_phase=result - print " Root has been found:" - print " p_phase %8f" % (p_phase) - print " q_phase %8f" % (q_phase) - print " (%d iterations, %g tolerance)" % (info.iterations, xtol) - return (p_phase, q_phase) - else: - raise Exception("Root has not been found") - - - diff --git a/examples/asc_test/asc_powers.py b/examples/asc_test/asc_powers.py deleted file mode 100644 index b79977564bd8d7b33d34a06742823ecbb222aef7..0000000000000000000000000000000000000000 --- a/examples/asc_test/asc_powers.py +++ /dev/null @@ -1,29 +0,0 @@ -import copy -from pykat import finesse - -def run(tmpkat): - - kat = copy.deepcopy(tmpkat) - - code1 = """ - ad EOM_up 9M nEOM1 - ad EOM_low -9M nEOM1 - pd cav_pow nITM2 - ad cav_c 0 nITM2 - ad WFS1_u 9M nWFS1 - ad WFS1_l -9M nWFS1 - ad WFS1_c 0 nWFS1 - ad WFS2_u 9M nWFS2 - ad WFS2_l -9M nWFS2 - ad WFS2_c 0 nWFS2 - noxaxis - """ - - kat.parseKatCode(code1) - - out = kat.run(printout=0,printerr=0) - - code1 = code1.split("\n") - for i in range(len(out.y)): - print " %8s: %.4e" % (out.ylabels[i], out.y[i]) - diff --git a/examples/asc_test/asc_resonance.py b/examples/asc_test/asc_resonance.py deleted file mode 100644 index dca7a508c8e981f47327d6dc9536354a4a6cb4a5..0000000000000000000000000000000000000000 --- a/examples/asc_test/asc_resonance.py +++ /dev/null @@ -1,41 +0,0 @@ -import copy -import sys -import scipy.optimize - -def run(tmpkat): - - kat = copy.deepcopy(tmpkat) - - code1 = """ - ad carr2 0 nITM1* - ad carr3 0 nITM2 - yaxis deg - """ - kat.parseKatCode(code1) - kat.noxaxis = True - - # function for root finding - def carrier_resonance(x): - kat.ETM.phi=x - out = kat.run(printout=0,printerr=0) - phase = (out.y[0]-out.y[1]-90)%360-180 - print '\r root finding: function value %g ' % phase , - sys.stdout.flush() - return phase - - # do root finding - xtol=1e-8 - (result, info)=scipy.optimize.bisect(carrier_resonance,0.0,40.0, xtol=xtol, maxiter=500, full_output=True) - - print "" - if info.converged: - print " Root has been found:" - print " ETM phi %8f" % (result) - print " (%d iterations, %g tolerance)" % (info.iterations, xtol) - return result - else: - raise Exception(" Root has not been found") - - -if __name__=="__main__": - run()