Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sean Leavey
pykat
Commits
7820cf03
Commit
7820cf03
authored
Aug 29, 2016
by
Daniel Brown
Browse files
Fixing R+T+L checking for float eps, adding component from trace output
parent
612925f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
pykat/__init__.py
View file @
7820cf03
...
...
@@ -3,7 +3,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
unicode_literals
__version__
=
"1.0.
8
"
__version__
=
"1.0.
9
"
# This flag is used to switch on the gui features in pkat at import time
USE_GUI
=
False
...
...
pykat/components.py
View file @
7820cf03
...
...
@@ -504,8 +504,8 @@ class mirror(AbstractMirrorComponent):
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
T
=
None
,
R
=
values
[
1
],
L
=
values
[
2
],
phi
=
values
[
3
])
def
getFinesseText
(
self
):
if
self
.
R
+
self
.
T
+
self
.
L
!=
1
:
raise
pkex
.
BasePyKatException
(
"Mirror {0} has R+T+L
!
=
1"
.
format
(
self
.
name
))
if
abs
(
self
.
R
+
self
.
T
+
self
.
L
-
1
)
>
1e-14
:
raise
pkex
.
BasePyKatException
(
"Mirror {0} has R+T+L =
{1}, must equal 1 +- 1e-14"
.
format
(
self
.
name
,
self
.
R
+
self
.
T
+
self
.
L
))
rtn
=
[]
...
...
@@ -639,8 +639,8 @@ class beamSplitter(AbstractMirrorComponent):
values
[
1
],
None
,
values
[
2
],
values
[
3
],
values
[
4
])
def
getFinesseText
(
self
):
if
self
.
R
+
self
.
T
+
self
.
L
!=
1
:
raise
pkex
.
BasePyKatException
(
"Beamsplitter {0} has R+T+L
!
=
1"
.
format
(
self
.
name
))
if
abs
(
self
.
R
+
self
.
T
+
self
.
L
-
1
)
>
1e-14
:
raise
pkex
.
BasePyKatException
(
"Beamsplitter {0} has R+T+L =
{1}, must equal 1 +- 1e-14"
.
format
(
self
.
name
,
self
.
R
+
self
.
T
+
self
.
L
))
rtn
=
[]
...
...
pykat/finesse.py
View file @
7820cf03
...
...
@@ -321,6 +321,9 @@ class katRun(object):
import
matplotlib.pyplot
as
pyplot
import
pykat.plotting
as
plt
if
self
.
noxaxis
==
True
:
raise
pkex
.
BasePyKatException
(
"This kat object has noxaxis=True, so there is nothing to plot."
)
if
not
show
:
pyplot
.
ioff
()
...
...
@@ -1662,12 +1665,11 @@ class kat(object):
a
=
line
.
split
(
':'
,
1
)
if
a
[
0
].
isdigit
():
#print("Found %s" % a[0])
values
=
a
[
1
].
split
()
node_name
=
values
[
1
].
split
(
"("
)[
0
]
component_name
=
values
[
2
].
split
(
"("
)[
0
]
line1x
=
ifile
.
readline
().
replace
(
'('
,
''
).
replace
(
')'
,
''
)
line2x
=
ifile
.
readline
().
replace
(
'('
,
''
).
replace
(
')'
,
''
)
line1y
=
ifile
.
readline
().
replace
(
'('
,
''
).
replace
(
')'
,
''
)
...
...
@@ -1679,7 +1681,7 @@ class kat(object):
qx
=
spqx
[
0
].
split
(
"="
)[
1
].
replace
(
'i'
,
'j'
).
replace
(
' '
,
''
)
qy
=
spqy
[
0
].
split
(
"="
)[
1
].
replace
(
'i'
,
'j'
).
replace
(
' '
,
''
)
traceData
[
-
1
][
node_name
]
=
(
pykat
.
beam_param
(
q
=
complex
(
qx
)),
pykat
.
beam_param
(
q
=
complex
(
qy
)))
traceData
[
-
1
][
node_name
]
=
(
pykat
.
beam_param
(
q
=
complex
(
qx
)),
pykat
.
beam_param
(
q
=
complex
(
qy
))
,
component_name
)
finally
:
ifile
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment