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
finesse
pykat
Commits
5a5c246a
Commit
5a5c246a
authored
11 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
making pykat read m1 and m2 correctly and addoing SIfloat ocnversion for
mirror params.
parent
cefecdf7
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/components.py
+31
-23
31 additions, 23 deletions
pykat/components.py
pykat/finesse.py
+1
-1
1 addition, 1 deletion
pykat/finesse.py
with
32 additions
and
24 deletions
pykat/components.py
+
31
−
23
View file @
5a5c246a
...
...
@@ -155,60 +155,61 @@ class mirror(Component):
self
.
_requested_node_names
.
append
(
node1
)
self
.
_requested_node_names
.
append
(
node2
)
self
.
__r_ap
=
float
(
r_ap
)
self
.
__mass
=
float
(
mass
)
self
.
__R
=
float
(
R
)
self
.
__T
=
float
(
T
)
self
.
__phi
=
float
(
phi
)
self
.
__Rcx
=
float
(
Rcx
)
self
.
__Rcy
=
float
(
Rcy
)
self
.
__xbeta
=
float
(
xbeta
)
self
.
__ybeta
=
float
(
ybeta
)
self
.
__r_ap
=
SIfloat
(
r_ap
)
self
.
__mass
=
SIfloat
(
mass
)
self
.
__R
=
SIfloat
(
R
)
self
.
__T
=
SIfloat
(
T
)
self
.
__phi
=
SIfloat
(
phi
)
self
.
__Rcx
=
SIfloat
(
Rcx
)
self
.
__Rcy
=
SIfloat
(
Rcy
)
self
.
__xbeta
=
SIfloat
(
xbeta
)
self
.
__ybeta
=
SIfloat
(
ybeta
)
@property
def
r_ap
(
self
):
return
Param
(
'
r_ap
'
,
self
.
__r_ap
)
@r_ap.setter
def
r_ap
(
self
,
value
):
self
.
__aperture
=
float
(
value
)
def
r_ap
(
self
,
value
):
self
.
__aperture
=
SI
float
(
value
)
@property
def
mass
(
self
):
return
Param
(
'
mass
'
,
self
.
__mass
)
@mass.setter
def
mass
(
self
,
value
):
self
.
__mass
=
float
(
value
)
def
mass
(
self
,
value
):
self
.
__mass
=
SI
float
(
value
)
@property
def
R
(
self
):
return
Param
(
'
R
'
,
self
.
__R
)
@R.setter
def
R
(
self
,
value
):
self
.
__R
=
float
(
value
)
def
R
(
self
,
value
):
self
.
__R
=
SI
float
(
value
)
@property
def
T
(
self
):
return
Param
(
'
T
'
,
self
.
__T
)
@T.setter
def
T
(
self
,
value
):
self
.
__T
=
float
(
value
)
def
T
(
self
,
value
):
self
.
__T
=
SI
float
(
value
)
@property
def
phi
(
self
):
return
Param
(
'
phi
'
,
self
.
__phi
)
@phi.setter
def
phi
(
self
,
value
):
self
.
__phi
=
float
(
value
)
def
phi
(
self
,
value
):
self
.
__phi
=
SI
float
(
value
)
@property
def
Rcx
(
self
):
return
Param
(
'
Rcx
'
,
self
.
__Rcx
)
@Rcx.setter
def
Rcx
(
self
,
value
):
self
.
__Rcx
=
float
(
value
)
def
Rcx
(
self
,
value
):
self
.
__Rcx
=
SI
float
(
value
)
@property
def
Rcy
(
self
):
return
Param
(
'
Rcy
'
,
self
.
__Rcy
)
@Rcy.setter
def
Rcy
(
self
,
value
):
self
.
__Rcy
=
float
(
value
)
def
Rcy
(
self
,
value
):
self
.
__Rcy
=
SI
float
(
value
)
@property
def
xbeta
(
self
):
return
Param
(
'
xbeta
'
,
self
.
__xbeta
)
@xbeta.setter
def
xbeta
(
self
,
value
):
self
.
__xbeta
=
float
(
value
)
def
xbeta
(
self
,
value
):
self
.
__xbeta
=
SI
float
(
value
)
@property
def
ybeta
(
self
):
return
Param
(
'
ybeta
'
,
self
.
__ybeta
)
@ybeta.setter
def
ybeta
(
self
,
value
):
self
.
__ybeta
=
float
(
value
)
def
ybeta
(
self
,
value
):
self
.
__ybeta
=
SI
float
(
value
)
@property
def
Rc
(
self
):
...
...
@@ -219,14 +220,14 @@ class mirror(Component):
@Rc.setter
def
Rc
(
self
,
value
):
self
.
Rcx
=
float
(
value
)
self
.
Rcy
=
float
(
value
)
self
.
Rcx
=
SI
float
(
value
)
self
.
Rcy
=
SI
float
(
value
)
@staticmethod
def
parseFinesseText
(
text
):
values
=
text
.
split
(
"
"
)
if
values
[
0
]
!=
"
m
"
:
if
values
[
0
]
!=
"
m
"
and
values
[
0
]
!=
"
m1
"
and
values
[
0
]
!=
"
m2
"
:
raise
exceptions
.
RuntimeError
(
"'
{0}
'
not a valid Finesse mirror command
"
.
format
(
text
))
values
.
pop
(
0
)
# remove initial value
...
...
@@ -234,7 +235,14 @@ class mirror(Component):
if
len
(
values
)
!=
6
:
raise
exceptions
.
RuntimeError
(
"
Mirror Finesse code format incorrect
'
{0}
'"
.
format
(
text
))
if
len
(
values
[
0
])
==
1
:
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
values
[
1
],
T
=
values
[
2
],
phi
=
values
[
3
])
else
:
if
values
[
0
][
1
]
==
1
:
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]),
T
=
values
[
1
],
phi
=
values
[
3
])
else
:
return
mirror
(
values
[
0
],
values
[
4
],
values
[
5
],
R
=
values
[
1
],
T
=
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]),
phi
=
values
[
3
])
def
getFinesseText
(
self
):
rtn
=
[]
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
1
−
1
View file @
5a5c246a
...
...
@@ -194,7 +194,7 @@ class kat(object):
first
=
line
.
split
(
"
"
,
1
)[
0
]
obj
=
None
if
(
first
==
"
m
"
):
if
(
first
==
"
m
"
or
first
==
"
m1
"
or
first
==
"
m2
"
):
obj
=
pykat
.
components
.
mirror
.
parseFinesseText
(
line
)
elif
(
first
==
"
s
"
):
obj
=
pykat
.
components
.
space
.
parseFinesseText
(
line
)
...
...
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