Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
3317e466
Commit
3317e466
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
fixes for mirror/bs components
parent
8f83578f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pykat/commands.py
+7
-1
7 additions, 1 deletion
pykat/commands.py
pykat/components.py
+21
-5
21 additions, 5 deletions
pykat/components.py
with
28 additions
and
6 deletions
pykat/commands.py
+
7
−
1
View file @
3317e466
...
@@ -11,6 +11,7 @@ from components import *
...
@@ -11,6 +11,7 @@ from components import *
from
structs
import
*
from
structs
import
*
from
pykat.param
import
Param
,
putter
from
pykat.param
import
Param
,
putter
import
pykat.exceptions
as
pkex
import
pykat.exceptions
as
pkex
from
collections
import
namedtuple
class
Command
(
object
):
class
Command
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -71,6 +72,11 @@ class gauss(object):
...
@@ -71,6 +72,11 @@ class gauss(object):
elif
len
(
values
)
==
8
:
elif
len
(
values
)
==
8
:
print
""
print
""
class
tf
(
Command
):
fQ
=
namedtuple
(
'
fQ
'
,
'
f
'
,
'
Q
'
)
def
__init__
(
self
,
name
,
poles
,
zeros
):
pass
class
xaxis
(
Command
):
class
xaxis
(
Command
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
pykat/components.py
+
21
−
5
View file @
3317e466
...
@@ -155,7 +155,7 @@ class Component(object):
...
@@ -155,7 +155,7 @@ class Component(object):
class
AbstractMirrorComponent
(
Component
):
class
AbstractMirrorComponent
(
Component
):
__metaclass__
=
abc
.
ABCMeta
__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
)
super
(
AbstractMirrorComponent
,
self
).
__init__
(
name
)
if
(
L
!=
None
and
R
!=
None
and
T
!=
None
)
and
SIfloat
(
R
)
+
SIfloat
(
T
)
+
SIfloat
(
L
)
!=
1
:
if
(
L
!=
None
and
R
!=
None
and
T
!=
None
)
and
SIfloat
(
R
)
+
SIfloat
(
T
)
+
SIfloat
(
L
)
!=
1
:
...
@@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component):
...
@@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component):
self
.
__xbeta
=
AttrParam
(
"
xbeta
"
,
self
,
SIfloat
(
xbeta
),
canFsig
=
True
,
fsig_name
=
"
x
"
)
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
.
__ybeta
=
AttrParam
(
"
ybeta
"
,
self
,
SIfloat
(
ybeta
),
canFsig
=
True
,
fsig_name
=
"
y
"
)
self
.
__mass
=
AttrParam
(
"
mass
"
,
self
,
SIfloat
(
mass
))
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
))
self
.
__r_ap
=
AttrParam
(
"
r_ap
"
,
self
,
SIfloat
(
r_ap
))
@property
@property
...
@@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component):
...
@@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component):
@mass.setter
@mass.setter
def
mass
(
self
,
value
):
self
.
__mass
.
value
=
SIfloat
(
value
)
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
@property
def
R
(
self
):
return
self
.
__R
def
R
(
self
):
return
self
.
__R
@R.setter
@R.setter
...
@@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component):
...
@@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component):
self
.
Rcy
=
value
self
.
Rcy
=
value
elif
key
in
[
"
Rc
"
,
"
ROC
"
,
"
r
"
,
"
rc
"
,
"
roc
"
]:
elif
key
in
[
"
Rc
"
,
"
ROC
"
,
"
r
"
,
"
rc
"
,
"
roc
"
]:
self
.
Rc
=
value
self
.
Rc
=
value
elif
key
in
[
"
M
, m
, Mass, mass
"
]:
elif
key
in
[
"
M
"
,
"
m
"
,
"
Mass
"
,
"
mass
"
]:
self
.
mass
=
value
self
.
mass
=
value
elif
key
in
[
"
xbeta, xBeta
"
]:
elif
key
in
[
"
xbeta
"
,
"
xBeta
"
]:
self
.
xbeta
=
value
self
.
xbeta
=
value
elif
key
in
[
"
ybeta
,
yBeta
"
]:
elif
key
in
[
"
ybeta
"
,
"
yBeta
"
]:
self
.
ybeta
=
value
self
.
ybeta
=
value
elif
key
in
[
"
x_off
"
]:
elif
key
in
[
"
x_off
"
]:
self
.
x_offset
=
value
self
.
x_offset
=
value
...
@@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component):
...
@@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component):
self
.
y_offset
=
value
self
.
y_offset
=
value
elif
key
in
[
"
r_ap
"
]:
elif
key
in
[
"
r_ap
"
]:
self
.
r_ap
=
value
self
.
r_ap
=
value
elif
key
in
[
"
Ix
"
,
"
ix
"
]:
self
.
Ix
=
value
elif
key
in
[
"
Iy
"
,
"
iy
"
]:
self
.
Iy
=
value
else
:
else
:
return
False
return
False
...
@@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent):
...
@@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent):
self
.
_requested_node_names
.
append
(
node3
)
self
.
_requested_node_names
.
append
(
node3
)
self
.
_requested_node_names
.
append
(
node4
)
self
.
_requested_node_names
.
append
(
node4
)
self
.
__alpha
=
Attr
Param
(
"
alpha
"
,
self
,
SIfloat
(
alpha
))
self
.
__alpha
=
Param
(
"
alpha
"
,
self
,
SIfloat
(
alpha
))
@property
@property
def
alpha
(
self
):
return
self
.
__alpha
def
alpha
(
self
):
return
self
.
__alpha
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment