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
Snippets
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
Sean Leavey
pykat
Commits
eb6ecbe4
Commit
eb6ecbe4
authored
9 years ago
by
Daniel Toyra
Browse files
Options
Downloads
Patches
Plain Diff
Removed print, and added comments
parent
241e44c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/components.py
+16
-2
16 additions, 2 deletions
pykat/components.py
with
16 additions
and
2 deletions
pykat/components.py
+
16
−
2
View file @
eb6ecbe4
...
...
@@ -902,6 +902,20 @@ class grating(Component):
class
isolator
(
Component
):
def
__init__
(
self
,
name
,
node1
,
node2
,
S
=
0
,
node3
=
"
dump
"
,
option
=
0
,
L
=
0
):
"""
Creates an isolator component. Ligth passes from node 1 to node 2, and from node
2 to node 3.
S Suppression factor for the reversed direction [power dB].
L Loss, fraction of input power loss. Number between 0 and 1.
option 0: Light passes from node1 to node2, and from node2 to node3. Light
is suppressed when going from node3 to node2, and from node2 to
node1.
1: Light passes from node2 to node1, and from node3 to node2. Light
is suppressed when going from node1 to node2, and from node2 to
node3.
"""
Component
.
__init__
(
self
,
name
)
self
.
_requested_node_names
.
append
(
node1
)
...
...
@@ -941,10 +955,11 @@ class isolator(Component):
if
len
(
values
)
==
4
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
values
[
1
],
option
=
option
)
elif
len
(
values
)
==
5
:
# Checking if loss is specified
# Checking if loss is specified
, should be a number.
if
values
[
2
].
isnumeric
():
return
isolator
(
values
[
0
],
values
[
3
],
values
[
4
],
values
[
1
],
L
=
values
[
2
],
option
=
option
)
# .. if not a number, it's a node name.
else
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
node3
=
values
[
4
],
S
=
values
[
1
],
option
=
option
)
...
...
@@ -964,7 +979,6 @@ class isolator(Component):
for
p
in
self
.
_params
:
rtn
.
extend
(
p
.
getFinesseText
())
print
(
rtn
)
return
rtn
def
getOptivisComponent
(
self
):
...
...
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