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
ad7ef75a
Commit
ad7ef75a
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
fixing loss parsing/inputs and fixing rsub on Param and gaussbeam
parent
553f88ea
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
pykat/components.py
+11
-14
11 additions, 14 deletions
pykat/components.py
pykat/finesse.py
+4
-4
4 additions, 4 deletions
pykat/finesse.py
pykat/param.py
+2
-1
2 additions, 1 deletion
pykat/param.py
pykat/utilities/optics/gaussian_beams.py
+2
-1
2 additions, 1 deletion
pykat/utilities/optics/gaussian_beams.py
with
19 additions
and
20 deletions
pykat/components.py
+
11
−
14
View file @
ad7ef75a
...
...
@@ -159,7 +159,7 @@ class AbstractMirrorComponent(Component):
super
(
AbstractMirrorComponent
,
self
).
__init__
(
name
)
if
(
L
!=
None
and
R
!=
None
and
T
!=
None
)
and
SIfloat
(
R
)
+
SIfloat
(
T
)
+
SIfloat
(
L
)
!=
1
:
raise
pkex
.
BasePyKatException
(
'
L+R+T must equal 1 if all are specified
'
)
raise
pkex
.
BasePyKatException
(
'
L+R+T must equal 1 if all are specified
at {0}
'
.
format
(
self
.
name
)
)
elif
(
R
!=
None
and
L
is
None
and
T
!=
None
):
L
=
1
-
(
SIfloat
(
R
)
+
SIfloat
(
T
))
elif
(
R
is
None
and
L
!=
None
and
T
!=
None
):
...
...
@@ -320,18 +320,15 @@ class beamSplitter(AbstractMirrorComponent):
if
len
(
values
[
0
])
==
2
:
values
.
pop
(
0
)
# remove initial value
return
beamSplitter
(
values
[
0
],
values
[
5
],
values
[
6
],
values
[
7
],
values
[
8
],
values
[
1
],
values
[
2
],
values
[
3
],
values
[
4
])
else
:
if
values
[
0
][
2
]
==
"
1
"
:
return
beamSplitter
(
values
[
0
],
values
[
5
],
values
[
6
],
values
[
7
],
values
[
8
],
values
[
1
],
values
[
2
],
None
,
values
[
3
],
values
[
4
])
elif
values
[
0
][
2
]
==
"
1
"
:
values
.
pop
(
0
)
# remove initial value
return
beamSplitter
(
values
[
0
],
values
[
5
],
values
[
6
],
values
[
7
],
values
[
8
],
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]),
values
[
1
],
values
[
3
],
values
[
4
])
values
[
7
],
values
[
8
],
None
,
values
[
1
],
values
[
2
],
values
[
3
],
values
[
4
])
else
:
values
.
pop
(
0
)
# remove initial value
return
beamSplitter
(
values
[
0
],
values
[
5
],
values
[
6
],
values
[
7
],
values
[
8
],
values
[
1
],
1.0
-
SIfloat
(
values
[
1
])
-
SIfloat
(
values
[
2
]),
values
[
3
],
values
[
7
],
values
[
8
],
values
[
1
],
None
,
values
[
3
],
values
[
4
])
def
getFinesseText
(
self
):
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
4
−
4
View file @
ad7ef75a
...
...
@@ -507,11 +507,11 @@ class kat(object):
if
component_name
in
self
.
__detectors
:
self
.
__detectors
[
component_name
].
scale
=
SIfloat
(
v
[
1
])
else
:
raise
pkex
.
BasePyKatException
(
"
scale command `{0}` refers to non-existing output
"
.
format
(
text
))
raise
pkex
.
BasePyKatException
(
"
scale command `{0}` refers to non-existing output
"
.
format
(
component_name
))
elif
len
(
values
)
==
2
:
self
.
scale
=
SIfloat
(
v
[
1
])
else
:
raise
pkex
.
BasePyKatException
(
"
scale command `{0}` is incorrect.
"
.
format
(
text
))
raise
pkex
.
BasePyKatException
(
"
scale command `{0}` is incorrect.
"
.
format
(
line
))
elif
(
first
==
"
pdtype
"
):
v
=
line
.
split
()
if
len
(
v
)
==
3
:
...
...
@@ -519,9 +519,9 @@ class kat(object):
if
component_name
in
self
.
__detectors
:
self
.
__detectors
[
component_name
].
pdtype
=
v
[
2
]
else
:
raise
pkex
.
BasePyKatException
(
"
pdtype command `{0}` refers to non-existing detector
"
.
format
(
text
))
raise
pkex
.
BasePyKatException
(
"
pdtype command `{0}` refers to non-existing detector
"
.
format
(
component_name
))
else
:
raise
pkex
.
BasePyKatException
(
"
pdtype command `{0}` is incorrect.
"
.
format
(
text
))
raise
pkex
.
BasePyKatException
(
"
pdtype command `{0}` is incorrect.
"
.
format
(
line
))
self
.
__currentTag
=
NO_BLOCK
...
...
This diff is collapsed.
Click to expand it.
pykat/param.py
+
2
−
1
View file @
ad7ef75a
...
...
@@ -138,7 +138,8 @@ class Param(putable, putter):
def
__isub__
(
self
,
a
):
return
self
.
value
-
(
a
)
__rsub__
=
__sub__
def
__rsub__
(
self
,
a
):
return
(
a
)
-
self
.
value
def
__div__
(
self
,
a
):
return
self
.
value
/
(
a
)
...
...
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/gaussian_beams.py
+
2
−
1
View file @
ad7ef75a
...
...
@@ -117,7 +117,8 @@ class gauss_param(object):
self
.
__q
-=
complex
(
a
)
return
self
__rsub__
=
__sub__
def
__rsub__
(
self
,
a
):
return
gauss_param
(
self
.
__lambda
,
self
.
__nr
,
complex
(
a
)
-
self
.
__q
)
def
__div__
(
self
,
a
):
return
gauss_param
(
self
.
__lambda
,
self
.
__nr
,
self
.
__q
/
complex
(
a
))
...
...
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