From 473c52a4d70ca69795749ca9d1323b076f0b545f Mon Sep 17 00:00:00 2001 From: Daniel Brown <ddb@star.sr.bham.ac.uk> Date: Tue, 23 Jul 2013 16:29:43 +0100 Subject: [PATCH] moving scripts to bin folder --- bin/parse.kat | 9 +++ bin/pykat_output.kat | 11 ++++ bin/test_parser.py | 19 ++++++ scripts/test_pykat_gui.py => bin/test_plot.py | 0 {scripts => bin}/test_property.py | 0 bin/test_pykat_gui.py | 62 +++++++++++++++++++ 6 files changed, 101 insertions(+) create mode 100644 bin/parse.kat create mode 100644 bin/pykat_output.kat create mode 100644 bin/test_parser.py rename scripts/test_pykat_gui.py => bin/test_plot.py (100%) rename {scripts => bin}/test_property.py (100%) create mode 100644 bin/test_pykat_gui.py diff --git a/bin/parse.kat b/bin/parse.kat new file mode 100644 index 0000000..84fdb87 --- /dev/null +++ b/bin/parse.kat @@ -0,0 +1,9 @@ +l l1 1 0 0 n1 +s s1 10 1 n1 n2 +m m1 0.5 0.5 0 n2 n3 +s s2 10 1 n3 n4 +m m2 0.5 0.5 0 n4 dump + +pd PD1 n2 + +xaxis m1 phi lin 0 360 360 diff --git a/bin/pykat_output.kat b/bin/pykat_output.kat new file mode 100644 index 0000000..19e7d20 --- /dev/null +++ b/bin/pykat_output.kat @@ -0,0 +1,11 @@ +l l1 1 0 0 n1 +s s1 10 1 n1 n2 +m m1 0.5 0.5 0 n2 n3 +s s2 10 1 n3 n4 +m m2 0.5 0.5 0 n4 dump + +pd PD1 n2 + +xaxis m1 phi lin 0 360 360 +gnuterm no +pyterm no diff --git a/bin/test_parser.py b/bin/test_parser.py new file mode 100644 index 0000000..5cae9e5 --- /dev/null +++ b/bin/test_parser.py @@ -0,0 +1,19 @@ +import sys +sys.path.append("../") + +from pykat import finesse +import numpy as np +import pylab as pl + +kat = finesse.kat() +kat.load("parse.kat") + +run = kat.run(printout=0,printerr=0) + +pl.figure() + +pl.plot(run.x,run.y) +pl.xlabel(run.xlabel) +pl.legend(run.ylabels) +pl.show() + diff --git a/scripts/test_pykat_gui.py b/bin/test_plot.py similarity index 100% rename from scripts/test_pykat_gui.py rename to bin/test_plot.py diff --git a/scripts/test_property.py b/bin/test_property.py similarity index 100% rename from scripts/test_property.py rename to bin/test_property.py diff --git a/bin/test_pykat_gui.py b/bin/test_pykat_gui.py new file mode 100644 index 0000000..fa1ad52 --- /dev/null +++ b/bin/test_pykat_gui.py @@ -0,0 +1,62 @@ +import sys +sys.path.append("../") + +from pykat import finesse +from pykat.detectors import * +from pykat.components import * +from pykat.commands import * +from pykat.structs import * +#from pykat.plotting import * +import numpy as np +import pylab as pl + +kat = finesse.kat() + +laser(kat,'l1','n1',1) +space(kat,'s1','n1','n2',1) + +mirror(kat,'m1','n2','n3',R=0.8,T=0.2) +space(kat,'s2','n3','n4',L=1) +mirror(kat,'m2','n4','n5',R=0.7,T=0.3) +cavity(kat, 'cav1','m1','n3','m2','n4') +space(kat,'s3','n5','n6',L=1) + +photodiode(kat,'pd_cav','n4') +photodiode(kat,'pd_ref','n2') +photodiode(kat,'pd_trs','n5') + +kat.m1.Rcx = -1000.0 +kat.m1.Rcy = -1000.0 +kat.m2.Rcx = 1000.0 +kat.m2.Rcy = 1000.0 + +xaxis(kat, Scale.linear, [0,360], kat.m2, kat.m2.phi, 1000) + +kat.maxtem = 0 + +run = kat.run(printout=0,printerr=0) + +#pl.figure() +#pl.ion() +#pl.plot(run.x,run.y) +#pl.xlabel(run.xlabel) +#pl.ylabel("Intensity [W]") +#pl.legend(run.ylabels) +#pl.show() + +kat.m1.R = 0.5 +kat.m1.T = 0.5 +kat.pd_cav.enabled = False + +run = kat.run(printout=0,printerr=0) + +#pl.figure() +#pl.plot(run.x,run.y) +#pl.xlabel(run.xlabel) +#pl.ylabel("Intensity [W]") +#pl.legend(run.ylabels) +#pl.show() + +kat.openGUI() + + -- GitLab