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
finesse
pykat
Commits
daae3ce9
Commit
daae3ce9
authored
9 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
removing float conversion again, after Daniels fix of SIfloat
parent
2edab215
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/asc_test/master.py
+2
-2
2 additions, 2 deletions
examples/asc_test/master.py
examples/asc_test/master2.py
+4
-4
4 additions, 4 deletions
examples/asc_test/master2.py
examples/asc_test/master4.py
+6
-6
6 additions, 6 deletions
examples/asc_test/master4.py
with
12 additions
and
12 deletions
examples/asc_test/master.py
+
2
−
2
View file @
daae3ce9
...
...
@@ -117,7 +117,7 @@ def pd_phase(tmpkat):
# function for root finding
def
PD_q_test
(
x
):
kat
.
PDrefl_q
.
phase1
=
float
(
x
)
kat
.
PDrefl_q
.
phase1
=
x
out
=
kat
.
run
()
print
(
'
\r
root finding: function value {0:<16g}
'
.
format
(
float
(
out
.
y
)),
end
=
''
)
sys
.
stdout
.
flush
()
...
...
@@ -180,7 +180,7 @@ def resonance(tmpkat):
# function for root finding
def
carrier_resonance
(
x
):
kat
.
ETM
.
phi
=
float
(
x
)
kat
.
ETM
.
phi
=
x
out
=
kat
.
run
()
phase
=
(
out
.
y
[
0
,
0
]
-
out
.
y
[
0
,
1
]
-
90
)
%
360
-
180.0
print
(
'
\r
root finding: function value {0:<16g}
'
.
format
(
float
(
phase
)),
end
=
''
)
...
...
This diff is collapsed.
Click to expand it.
examples/asc_test/master2.py
+
4
−
4
View file @
daae3ce9
...
...
@@ -178,7 +178,7 @@ def asc_phases(tmpkat):
kat
.
maxtem
=
1
def
demod_phase1
(
x
):
kat
.
WFS1_I
.
phase1
=
float
(
x
[
0
]
)
kat
.
WFS1_I
.
phase1
=
x
[
0
]
out
=
kat
.
run
()
signal
=
out
[
"
WFS1_I
"
]
print
(
'
\r
minimising: function value {0:<16g}
'
.
format
(
float
(
signal
)),
end
=
''
)
...
...
@@ -186,7 +186,7 @@ def asc_phases(tmpkat):
return
-
1
*
abs
(
signal
)
def
demod_phase2
(
x
):
kat
.
WFS2_I
.
phase1
=
float
(
x
[
0
]
)
kat
.
WFS2_I
.
phase1
=
x
[
0
]
out
=
kat
.
run
()
signal
=
out
[
"
WFS2_I
"
]
print
(
'
\r
minimising: function value {0:<16g}
'
.
format
(
float
(
signal
)),
end
=
''
)
...
...
@@ -196,14 +196,14 @@ def asc_phases(tmpkat):
kat
.
ITM
.
ybeta
=
1e-10
kat
.
ETM
.
ybeta
=
0.0
res
=
fmin
(
demod_phase1
,
[
0.0
],
xtol
=
1e-8
,
disp
=
False
)
WFS1_phase
=
float
(
res
[
0
]
)
WFS1_phase
=
res
[
0
]
print
(
""
)
print
(
"
WFS1 demod phase : %.10g deg
"
%
WFS1_phase
)
kat
.
ITM
.
ybeta
=
0.0
kat
.
ETM
.
ybeta
=-
1e-10
res
=
fmin
(
demod_phase2
,
[
0.0
],
xtol
=
1e-8
,
disp
=
False
)
WFS2_phase
=
float
(
res
[
0
]
)
WFS2_phase
=
res
[
0
]
print
(
""
)
print
(
"
WFS2 demod phase : %.10g deg
"
%
WFS2_phase
)
return
(
WFS1_phase
,
WFS2_phase
)
...
...
This diff is collapsed.
Click to expand it.
examples/asc_test/master4.py
+
6
−
6
View file @
daae3ce9
...
...
@@ -16,10 +16,10 @@ import copy
import
sys
def
set_thermal_lens
(
kat
,
f
):
kat
.
ITM_TL
.
f
=
f
loat
(
f
)
kat
.
ITM_TL
.
f
=
f
# if a bs-based cavity is used, we need to set second lens
if
"
ITM_TL_r
"
in
kat
.
_kat__components
:
kat
.
ITM_TL_r
.
f
=
f
loat
(
f
)
kat
.
ITM_TL_r
.
f
=
f
return
(
kat
)
def
main
():
...
...
@@ -91,14 +91,14 @@ def main():
x1
=
0.70
x2
=
0.30
if
"
ITM_TL_r
"
in
kat
.
_kat__components
:
beam50
=
beam_param
(
z
=
float
(
x1
*
beam1
[
1
].
z
+
x2
*
beam2
[
1
].
z
),
w0
=
float
(
x1
*
beam1
[
1
].
w0
+
x2
*
beam2
[
1
].
w0
))
beam5
=
beam_param
(
z
=
float
(
x1
*
beam1
[
1
].
z
+
x2
*
beam3
[
1
].
z
),
w0
=
float
(
x1
*
beam1
[
1
].
w0
+
x2
*
beam3
[
1
].
w0
))
beam50
=
beam_param
(
z
=
(
x1
*
beam1
[
1
].
z
+
x2
*
beam2
[
1
].
z
),
w0
=
(
x1
*
beam1
[
1
].
w0
+
x2
*
beam2
[
1
].
w0
))
beam5
=
beam_param
(
z
=
(
x1
*
beam1
[
1
].
z
+
x2
*
beam3
[
1
].
z
),
w0
=
(
x1
*
beam1
[
1
].
w0
+
x2
*
beam3
[
1
].
w0
))
node_text
=
"
at ITM->nITM1r
"
t_comp
=
kat
.
ITM
t_node
=
kat
.
ITM
.
nITM1r
else
:
beam50
=
beam_param
(
z
=
float
(
x1
*
beam1
[
4
].
z
+
x2
*
beam2
[
4
].
z
),
w0
=
float
(
x1
*
beam1
[
4
].
w0
+
x2
*
beam2
[
4
].
w0
))
beam5
=
beam_param
(
z
=
float
(
x1
*
beam1
[
4
].
z
+
x2
*
beam3
[
4
].
z
),
w0
=
float
(
x1
*
beam1
[
4
].
w0
+
x2
*
beam3
[
4
].
w0
))
beam50
=
beam_param
(
z
=
(
x1
*
beam1
[
4
].
z
+
x2
*
beam2
[
4
].
z
),
w0
=
(
x1
*
beam1
[
4
].
w0
+
x2
*
beam2
[
4
].
w0
))
beam5
=
beam_param
(
z
=
(
x1
*
beam1
[
4
].
z
+
x2
*
beam3
[
4
].
z
),
w0
=
(
x1
*
beam1
[
4
].
w0
+
x2
*
beam3
[
4
].
w0
))
node_text
=
"
at s2->npo2
"
t_comp
=
kat
.
s2
t_node
=
kat
.
s2
.
npo2
...
...
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