Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
3317e466
Commit
3317e466
authored
Feb 27, 2014
by
Daniel Brown
Browse files
fixes for mirror/bs components
parent
8f83578f
Changes
2
Hide whitespace changes
Inline
Side-by-side
pykat/commands.py
View file @
3317e466
...
...
@@ -11,6 +11,7 @@ from components import *
from
structs
import
*
from
pykat.param
import
Param
,
putter
import
pykat.exceptions
as
pkex
from
collections
import
namedtuple
class
Command
(
object
):
def
__init__
(
self
):
...
...
@@ -71,7 +72,12 @@ class gauss(object):
elif
len
(
values
)
==
8
:
print
""
class
tf
(
Command
):
fQ
=
namedtuple
(
'fQ'
,
'f'
,
'Q'
)
def
__init__
(
self
,
name
,
poles
,
zeros
):
pass
class
xaxis
(
Command
):
"""
The xaxis object is a unique object to each pykat.finesse.kat instance. It provides
...
...
pykat/components.py
View file @
3317e466
...
...
@@ -155,7 +155,7 @@ class Component(object):
class
AbstractMirrorComponent
(
Component
):
__metaclass__
=
abc
.
ABCMeta
def
__init__
(
self
,
name
,
R
=
None
,
T
=
None
,
L
=
None
,
phi
=
0
,
Rcx
=
None
,
Rcy
=
None
,
xbeta
=
None
,
ybeta
=
None
,
mass
=
None
,
r_ap
=
None
):
def
__init__
(
self
,
name
,
R
=
None
,
T
=
None
,
L
=
None
,
phi
=
0
,
Rcx
=
None
,
Rcy
=
None
,
xbeta
=
None
,
ybeta
=
None
,
mass
=
None
,
r_ap
=
None
,
Ix
=
None
,
Iy
=
None
):
super
(
AbstractMirrorComponent
,
self
).
__init__
(
name
)
if
(
L
!=
None
and
R
!=
None
and
T
!=
None
)
and
SIfloat
(
R
)
+
SIfloat
(
T
)
+
SIfloat
(
L
)
!=
1
:
...
...
@@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component):
self
.
__xbeta
=
AttrParam
(
"xbeta"
,
self
,
SIfloat
(
xbeta
),
canFsig
=
True
,
fsig_name
=
"x"
)
self
.
__ybeta
=
AttrParam
(
"ybeta"
,
self
,
SIfloat
(
ybeta
),
canFsig
=
True
,
fsig_name
=
"y"
)
self
.
__mass
=
AttrParam
(
"mass"
,
self
,
SIfloat
(
mass
))
self
.
__Ix
=
AttrParam
(
"Ix"
,
self
,
SIfloat
(
Ix
))
self
.
__Iy
=
AttrParam
(
"Iy"
,
self
,
SIfloat
(
Iy
))
self
.
__r_ap
=
AttrParam
(
"r_ap"
,
self
,
SIfloat
(
r_ap
))
@
property
...
...
@@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component):
@
mass
.
setter
def
mass
(
self
,
value
):
self
.
__mass
.
value
=
SIfloat
(
value
)
@
property
def
Ix
(
self
):
return
self
.
__Ix
@
Ix
.
setter
def
Ix
(
self
,
value
):
self
.
__Ix
.
value
=
SIfloat
(
value
)
@
property
def
Iy
(
self
):
return
self
.
__Iy
@
Iy
.
setter
def
Iy
(
self
,
value
):
self
.
__Iy
.
value
=
SIfloat
(
value
)
@
property
def
R
(
self
):
return
self
.
__R
@
R
.
setter
...
...
@@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component):
self
.
Rcy
=
value
elif
key
in
[
"Rc"
,
"ROC"
,
"r"
,
"rc"
,
"roc"
]:
self
.
Rc
=
value
elif
key
in
[
"M
, m
, Mass, mass"
]:
elif
key
in
[
"M
"
,
"m"
,
"
Mass
"
,
"
mass"
]:
self
.
mass
=
value
elif
key
in
[
"xbeta, xBeta"
]:
elif
key
in
[
"xbeta
"
,
"
xBeta"
]:
self
.
xbeta
=
value
elif
key
in
[
"ybeta
,
yBeta"
]:
elif
key
in
[
"ybeta
"
,
"
yBeta"
]:
self
.
ybeta
=
value
elif
key
in
[
"x_off"
]:
self
.
x_offset
=
value
...
...
@@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component):
self
.
y_offset
=
value
elif
key
in
[
"r_ap"
]:
self
.
r_ap
=
value
elif
key
in
[
"Ix"
,
"ix"
]:
self
.
Ix
=
value
elif
key
in
[
"Iy"
,
"iy"
]:
self
.
Iy
=
value
else
:
return
False
...
...
@@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent):
self
.
_requested_node_names
.
append
(
node3
)
self
.
_requested_node_names
.
append
(
node4
)
self
.
__alpha
=
Attr
Param
(
"alpha"
,
self
,
SIfloat
(
alpha
))
self
.
__alpha
=
Param
(
"alpha"
,
self
,
SIfloat
(
alpha
))
@
property
def
alpha
(
self
):
return
self
.
__alpha
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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