test_plot.py 734 Bytes
Newer Older
1
import pykat
2
pykat.init_pykat_plotting()
3

Daniel Brown's avatar
Daniel Brown committed
4
5
6
7
8
9
10
11
12
from pykat import finesse
from pykat.detectors import *
from pykat.components import *
from pykat.commands import *
from pykat.structs import *

import numpy as np

code = """
13
l l1 1 0 0 n1 
Daniel Brown's avatar
Daniel Brown committed
14
s s1 10 1 n1 n2
Daniel Brown's avatar
Daniel Brown committed
15
m m1 0.9 0.1 0 n2 n3
Daniel Brown's avatar
Daniel Brown committed
16
s s2 10 1 n3 n4
17
m m2 0.91 0.09 0 n4 n5
Daniel Brown's avatar
Daniel Brown committed
18
s s3 10 1 n5 n6
19

Daniel Brown's avatar
Daniel Brown committed
20
yaxis abs:deg
21

Daniel Brown's avatar
Daniel Brown committed
22
ad refl 0 0 0 n2
23
ad circ 0 0 0 n4
Daniel Brown's avatar
Daniel Brown committed
24
ad tran 0 0 0 n5
25
26
27
pd pd_cav n3

cav c1 m1 n3 m2 n4
Daniel Brown's avatar
Daniel Brown committed
28
29

attr m1 Rc 1
Daniel Brown's avatar
Daniel Brown committed
30
31
32
33
34
"""

kat = finesse.kat()
kat.parseCommands(code)

35
kat.add(xaxis("lin", [0, 360], kat.m2.phi, 500))
Daniel Brown's avatar
Daniel Brown committed
36
37
38
39
40
41
42
43

kat.m1.Rcx = -1000.0
kat.m1.Rcy = -1000.0
kat.m2.Rcx =  1000.0
kat.m2.Rcy =  1000.0

kat.maxtem = 0

44
out = kat.run()
Daniel Brown's avatar
Daniel Brown committed
45
#fig = out.plot(yaxis="log abs:deg")
46
47

#fig.savefig("test_plot.pdf")
Daniel Brown's avatar
Daniel Brown committed
48
out.info()