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
ee9aae95
Commit
ee9aae95
authored
11 years ago
by
Sean Leavey
Browse files
Options
Downloads
Patches
Plain Diff
Added isolator component
parent
c8ceb252
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/test_pass_though.py
+1
-0
1 addition, 0 deletions
bin/test_pass_though.py
pykat/components.py
+39
-2
39 additions, 2 deletions
pykat/components.py
pykat/finesse.py
+2
-0
2 additions, 0 deletions
pykat/finesse.py
with
42 additions
and
2 deletions
bin/test_pass_though.py
+
1
−
0
View file @
ee9aae95
...
...
@@ -16,6 +16,7 @@ l l1 1 0 0 n1
s s1 10 1 n1 n2
m m1 1 0 0 n2 n3
gr4 grating 1500 n4 n5 n6 n7
isol isolator 60 n8 n9
pd refl n2
...
...
This diff is collapsed.
Click to expand it.
pykat/components.py
+
39
−
2
View file @
ee9aae95
...
...
@@ -368,9 +368,9 @@ class space(Component):
values
.
pop
(
0
)
# remove initial value
if
len
(
values
)
==
5
:
return
space
(
values
[
0
],
values
[
3
],
values
[
4
],
L
=
values
[
1
],
n
=
values
[
2
])
return
space
(
values
[
0
],
values
[
3
],
values
[
4
],
values
[
1
],
values
[
2
])
elif
len
(
values
)
==
4
:
return
space
(
values
[
0
],
values
[
2
],
values
[
3
],
L
=
values
[
1
])
return
space
(
values
[
0
],
values
[
2
],
values
[
3
],
values
[
1
])
else
:
raise
exceptions
.
RuntimeError
(
"
Space Finesse code format incorrect
'
{0}
'"
.
format
(
text
))
...
...
@@ -520,6 +520,43 @@ class grating(Component):
return
self
.
_QItem
class
isolator
(
Component
):
def
__init__
(
self
,
name
,
node1
,
node2
,
S
=
0
):
Component
.
__init__
(
self
,
name
)
self
.
_requested_node_names
.
append
(
node1
)
self
.
_requested_node_names
.
append
(
node2
)
self
.
__S
=
SIfloat
(
S
)
@property
def
S
(
self
):
return
Param
(
'
S
'
,
self
.
__S
)
@S.setter
def
S
(
self
,
value
):
self
.
__S
=
SIfloat
(
value
)
@staticmethod
def
parseFinesseText
(
text
):
values
=
text
.
split
(
"
"
)
if
values
[
0
]
!=
"
isol
"
:
raise
exceptions
.
RuntimeError
(
"'
{0}
'
not a valid Finesse isolator command
"
.
format
(
text
))
values
.
pop
(
0
)
# remove initial value
if
len
(
values
)
==
4
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
values
[
1
])
else
:
raise
exceptions
.
RuntimeError
(
"
Isolator Finesse code format incorrect
'
{0}
'"
.
format
(
text
))
def
getFinesseText
(
self
):
return
'
isol {0} {1} {2} {3}
'
.
format
(
self
.
name
,
self
.
S
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
)
def
getQGraphicsItem
(
self
):
if
self
.
_QItem
==
None
:
self
.
_QItem
=
pykat
.
gui
.
graphics
.
SpaceQGraphicsItem
(
self
)
# TODO: make isolator graphic
return
self
.
_QItem
class
laser
(
Component
):
def
__init__
(
self
,
name
,
node
,
P
=
1
,
f_offset
=
0
,
phase
=
0
):
Component
.
__init__
(
self
,
name
)
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
2
−
0
View file @
ee9aae95
...
...
@@ -207,6 +207,8 @@ class kat(object):
obj
=
pykat
.
components
.
beamSplitter
.
parseFinesseText
(
line
)
elif
(
first
[
0
:
2
]
==
"
gr
"
):
obj
=
pykat
.
components
.
grating
.
parseFinesseText
(
line
)
elif
(
first
[
0
:
4
]
==
"
isol
"
):
obj
=
pykat
.
components
.
isolator
.
parseFinesseText
(
line
)
elif
(
first
[
0
:
2
]
==
"
pd
"
):
obj
=
pykat
.
detectors
.
photodiode
.
parseFinesseText
(
line
)
elif
(
first
==
"
xaxis
"
or
first
==
"
x2axis
"
or
first
==
"
xaxis*
"
or
first
==
"
x2axis*
"
):
...
...
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