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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
8d0567f5
Commit
8d0567f5
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
Adding in Loss for abstract mirror component
parent
925906a0
No related branches found
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
+14
-1
14 additions, 1 deletion
pykat/commands.py
pykat/components.py
+25
-4
25 additions, 4 deletions
pykat/components.py
with
39 additions
and
5 deletions
pykat/commands.py
+
14
−
1
View file @
8d0567f5
...
...
@@ -73,8 +73,21 @@ class gauss(object):
class
xaxis
(
Command
):
"""
The xaxis object is a unique object to each pykat.finesse.kat instance. It provides
and interface to the xaxis command in FINESSE.
"""
def
__init__
(
self
,
scale
,
limits
,
param
,
steps
,
comp
=
None
,
axis_type
=
"
xaxis
"
):
"""
Typical usage:
xaxis([
"
lin
"
or
"
log
"
], [upper, lower], param, steps)
param must be an object of the type pykat.param.Param whose
isPutable() member returns true.
steps is the number of points to compute between upper and lower limits.
"""
self
.
_axis_type
=
axis_type
self
.
x
=
putter
(
"
x1
"
)
...
...
This diff is collapsed.
Click to expand it.
pykat/components.py
+
25
−
4
View file @
8d0567f5
...
...
@@ -155,11 +155,24 @@ class Component(object):
class
AbstractMirrorComponent
(
Component
):
__metaclass__
=
abc
.
ABCMeta
def
__init__
(
self
,
name
,
R
=
0
,
T
=
0
,
phi
=
0
,
Rcx
=
0
,
Rcy
=
0
,
xbeta
=
0
,
ybeta
=
0
,
mass
=
0
,
r_ap
=
0
):
def
__init__
(
self
,
name
,
R
=
None
,
T
=
None
,
L
=
None
,
phi
=
0
,
Rcx
=
0
,
Rcy
=
0
,
xbeta
=
0
,
ybeta
=
0
,
mass
=
0
,
r_ap
=
0
):
super
(
AbstractMirrorComponent
,
self
).
__init__
(
name
)
if
(
L
!=
None
and
R
!=
None
and
T
!=
None
)
and
R
+
T
+
L
!=
1
:
raise
pkex
.
BasePyKatException
(
'
L+R+T must equal 1 if all are specified
'
)
elif
(
R
!=
None
and
L
is
None
and
T
!=
None
):
L
=
1
-
(
R
+
T
)
elif
(
R
is
None
and
L
!=
None
and
T
!=
None
):
R
=
1
-
(
L
+
T
)
elif
(
R
!=
None
and
L
!=
None
and
T
is
None
):
T
=
1
-
(
L
+
R
)
else
:
raise
pkex
.
BasePyKatException
(
'
Must specify at least two of L, R or T
'
)
self
.
__R
=
Param
(
"
R
"
,
self
,
SIfloat
(
R
))
self
.
__T
=
Param
(
"
T
"
,
self
,
SIfloat
(
T
))
self
.
__L
=
Param
(
"
L
"
,
self
,
SIfloat
(
L
))
self
.
__phi
=
Param
(
"
phi
"
,
self
,
SIfloat
(
phi
),
canFsig
=
True
,
fsig_name
=
"
phase
"
)
self
.
__Rcx
=
AttrParam
(
"
Rcx
"
,
self
,
SIfloat
(
Rcx
))
self
.
__Rcy
=
AttrParam
(
"
Rcy
"
,
self
,
SIfloat
(
Rcy
))
...
...
@@ -168,6 +181,11 @@ class AbstractMirrorComponent(Component):
self
.
__mass
=
AttrParam
(
"
mass
"
,
self
,
SIfloat
(
mass
))
self
.
__r_ap
=
AttrParam
(
"
r_ap
"
,
self
,
SIfloat
(
r_ap
))
@property
def
L
(
self
):
return
self
.
__L
@L.setter
def
L
(
self
,
value
):
self
.
__L
.
value
=
SIfloat
(
value
)
@property
def
r_ap
(
self
):
return
self
.
__r_ap
@r_ap.setter
...
...
@@ -248,12 +266,15 @@ class mirror(AbstractMirrorComponent):
else
:
if
values
[
0
][
1
]
==
"
1
"
:
values
.
pop
(
0
)
# remove initial value
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]
)
,
T
=
values
[
1
],
phi
=
values
[
3
])
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
L
=
values
[
2
],
T
=
values
[
1
],
phi
=
values
[
3
])
else
:
values
.
pop
(
0
)
# remove initial value
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
values
[
1
],
T
=
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]
)
,
phi
=
values
[
3
])
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
values
[
1
],
L
=
values
[
2
],
phi
=
values
[
3
])
def
getFinesseText
(
self
):
if
R
+
T
+
L
>
1
:
raise
pkex
.
BasePyKatException
(
"
Mirror {0} has R+T+L > 1
"
.
format
(
self
.
name
))
rtn
=
[]
rtn
.
append
(
'
m {0} {1} {2} {3} {4} {5}
'
.
format
(
...
...
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