test_parser.py 372 Bytes
Newer Older
1
2
from pykat import finesse
from pykat.commands import xaxis
Daniel Brown's avatar
Daniel Brown committed
3
4
import pylab as pl

5
6
7
8
9
10
11
12
13
14
15
code = """
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

ad ad1 0 n2
"""

kat = finesse.kat(kat_code = code)
Daniel Brown's avatar
Daniel Brown committed
16

17
kat.add(xaxis("lin", [0, 360], kat.m2, kat.m2.phi, 1000))
Daniel Brown's avatar
Daniel Brown committed
18

19
r = kat.run(printerr=1)
Daniel Brown's avatar
Daniel Brown committed
20

21
22
pl.plot(r.x, r.y)
pl.show()
23