Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Steinlechner
pykat
Commits
ff7a2761
Commit
ff7a2761
authored
Dec 18, 2013
by
Andreas Freise
Browse files
removing files which are now included in master.py
parent
7ee3b949
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/asc_test/asc_pd_phase.py
deleted
100644 → 0
View file @
7ee3b949
import
copy
import
sys
import
scipy.optimize
from
pykat
import
finesse
def
run
(
tmpkat
):
kat
=
copy
.
deepcopy
(
tmpkat
)
code_det
=
"""
pd1 PDrefl_q 9M 90 nWFS1
%scale 2 PDrefl_q
"""
kat
.
parseKatCode
(
code_det
)
kat
.
noxaxis
=
True
# function for root finding
def
PD_q_test
(
x
):
kat
.
PDrefl_q
.
phi
[
0
]
=
x
out
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
print
'
\r
root finding: function value %g '
%
out
.
y
,
sys
.
stdout
.
flush
()
return
out
.
y
# do root finding
xtol
=
1e-8
(
result
,
info
)
=
scipy
.
optimize
.
bisect
(
PD_q_test
,
80.0
,
100.0
,
xtol
=
xtol
,
maxiter
=
500
,
full_output
=
True
)
print
""
if
info
.
converged
:
p_phase
=
result
-
90.0
q_phase
=
result
print
" Root has been found:"
print
" p_phase %8f"
%
(
p_phase
)
print
" q_phase %8f"
%
(
q_phase
)
print
" (%d iterations, %g tolerance)"
%
(
info
.
iterations
,
xtol
)
return
(
p_phase
,
q_phase
)
else
:
raise
Exception
(
"Root has not been found"
)
examples/asc_test/asc_powers.py
deleted
100644 → 0
View file @
7ee3b949
import
copy
from
pykat
import
finesse
def
run
(
tmpkat
):
kat
=
copy
.
deepcopy
(
tmpkat
)
code1
=
"""
ad EOM_up 9M nEOM1
ad EOM_low -9M nEOM1
pd cav_pow nITM2
ad cav_c 0 nITM2
ad WFS1_u 9M nWFS1
ad WFS1_l -9M nWFS1
ad WFS1_c 0 nWFS1
ad WFS2_u 9M nWFS2
ad WFS2_l -9M nWFS2
ad WFS2_c 0 nWFS2
noxaxis
"""
kat
.
parseKatCode
(
code1
)
out
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
code1
=
code1
.
split
(
"
\n
"
)
for
i
in
range
(
len
(
out
.
y
)):
print
" %8s: %.4e"
%
(
out
.
ylabels
[
i
],
out
.
y
[
i
])
examples/asc_test/asc_resonance.py
deleted
100644 → 0
View file @
7ee3b949
import
copy
import
sys
import
scipy.optimize
def
run
(
tmpkat
):
kat
=
copy
.
deepcopy
(
tmpkat
)
code1
=
"""
ad carr2 0 nITM1*
ad carr3 0 nITM2
yaxis deg
"""
kat
.
parseKatCode
(
code1
)
kat
.
noxaxis
=
True
# function for root finding
def
carrier_resonance
(
x
):
kat
.
ETM
.
phi
=
x
out
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
phase
=
(
out
.
y
[
0
]
-
out
.
y
[
1
]
-
90
)
%
360
-
180
print
'
\r
root finding: function value %g '
%
phase
,
sys
.
stdout
.
flush
()
return
phase
# do root finding
xtol
=
1e-8
(
result
,
info
)
=
scipy
.
optimize
.
bisect
(
carrier_resonance
,
0.0
,
40.0
,
xtol
=
xtol
,
maxiter
=
500
,
full_output
=
True
)
print
""
if
info
.
converged
:
print
" Root has been found:"
print
" ETM phi %8f"
%
(
result
)
print
" (%d iterations, %g tolerance)"
%
(
info
.
iterations
,
xtol
)
return
result
else
:
raise
Exception
(
" Root has not been found"
)
if
__name__
==
"__main__"
:
run
()
Write
Preview
Supports
Markdown
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