Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pykat
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
finesse
pykat
Commits
89c6bf26
Commit
89c6bf26
authored
Mar 06, 2018
by
Daniel Toyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved the mode matching function"
parent
06aebbea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
pykat/ifo/__init__.py
pykat/ifo/__init__.py
+17
-14
No files found.
pykat/ifo/__init__.py
View file @
89c6bf26
...
...
@@ -621,20 +621,23 @@ def modematch(kat, components, cavs, node, verbose = False):
Nc
=
len
(
cavs
)
Np
=
len
(
components
)
kat1
=
kat
.
deepcopy
()
kat2
=
kat
.
deepcopy
()
# Storing parameters to tune, and their initial values, in lists
attrs
=
[]
attrs2
=
[]
p0
=
[]
for
c
in
components
:
if
isinstance
(
kat1
.
components
[
c
],
pykat
.
components
.
lens
):
attrs
.
append
(
kat1
.
components
[
c
])
p0
.
append
(
kat1
.
components
[
c
].
f
.
value
)
elif
(
isinstance
(
kat1
.
components
[
c
],
pykat
.
components
.
mirror
)
or
isinstance
(
kat1
.
components
[
c
],
pykat
.
components
.
beamSplitter
)):
attrs
.
append
(
kat1
.
components
[
c
])
p0
.
append
(
kat1
.
components
[
c
].
Rc
.
value
)
elif
isinstance
(
kat1
.
components
[
c
],
pykat
.
components
.
space
):
attrs
.
append
(
kat1
.
components
[
c
])
p0
.
append
(
kat1
.
components
[
c
].
L
.
value
)
attrs
.
append
(
kat1
.
components
[
c
])
attrs2
.
append
(
kat2
.
components
[
c
])
# Switching off cavity commands for cavities not in cavs
for
cav
in
kat1
.
getAll
(
pykat
.
commands
.
cavity
):
...
...
@@ -685,26 +688,26 @@ def modematch(kat, components, cavs, node, verbose = False):
# Setting new parameters to kat-object
for
k
in
range
(
Np
):
if
isinstance
(
attrs
[
k
],
pykat
.
components
.
lens
):
attrs
[
k
].
f
=
out
.
x
[
k
]
elif
isinstance
(
attrs
[
k
],
pykat
.
components
.
space
):
attrs
[
k
].
L
=
out
.
x
[
k
]
elif
(
isinstance
(
attrs
[
k
],
pykat
.
components
.
mirror
)
or
isinstance
(
attrs
[
k
],
pykat
.
components
.
beamSplitter
)):
attrs
[
k
].
Rc
=
out
.
x
[
k
]
if
isinstance
(
attrs
2
[
k
],
pykat
.
components
.
lens
):
attrs
2
[
k
].
f
=
out
.
x
[
k
]
elif
isinstance
(
attrs
2
[
k
],
pykat
.
components
.
space
):
attrs
2
[
k
].
L
=
out
.
x
[
k
]
elif
(
isinstance
(
attrs
2
[
k
],
pykat
.
components
.
mirror
)
or
isinstance
(
attrs
2
[
k
],
pykat
.
components
.
beamSplitter
)):
attrs
2
[
k
].
Rc
=
out
.
x
[
k
]
if
verbose
:
print
(
'Maximum mismatch: {:.2e} --> {:.2e}'
.
format
(
mm0
.
max
(),
out
.
fun
))
for
c
in
components
:
if
isinstance
(
kat
.
components
[
c
],
pykat
.
components
.
lens
):
print
(
' {}.f: {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
f
.
value
,
kat
1
.
components
[
c
].
f
.
value
))
print
(
' {}.f: {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
f
.
value
,
kat
2
.
components
[
c
].
f
.
value
))
elif
isinstance
(
kat
.
components
[
c
],
pykat
.
components
.
space
):
print
(
' {}.L: {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
L
.
value
,
kat
1
.
components
[
c
].
L
.
value
))
print
(
' {}.L: {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
L
.
value
,
kat
2
.
components
[
c
].
L
.
value
))
elif
(
isinstance
(
kat
.
components
[
c
],
pykat
.
components
.
mirror
)
or
isinstance
(
kat
.
components
[
c
],
pykat
.
components
.
beamSplitter
)):
print
(
' {}.Rc = {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
Rc
.
value
,
kat
1
.
components
[
c
].
Rc
.
value
))
print
(
' {}.Rc = {:.5e} m --> {:.5e} m'
.
format
(
c
,
kat
.
components
[
c
].
Rc
.
value
,
kat
2
.
components
[
c
].
Rc
.
value
))
return
kat
1
return
kat
2
,
out
.
x
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment