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
62c6bab8
Commit
62c6bab8
authored
11 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
next part of teh asc test example done.
parent
51981930
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
examples/asc_test/master2.py
+71
-10
71 additions, 10 deletions
examples/asc_test/master2.py
with
71 additions
and
10 deletions
examples/asc_test/master2.py
+
71
−
10
View file @
62c6bab8
...
...
@@ -2,6 +2,7 @@
from
pykat
import
finesse
from
pykat.commands
import
*
import
pylab
as
pl
import
numpy
as
np
import
shelve
import
copy
...
...
@@ -52,6 +53,9 @@ def main():
print
"
--------------------------------------------------------
"
print
"
5. checking wavefront tilt for ITM/ETM tilt of 0.1nrad
"
#kat.PDrefl_p.enabled = False
#kat.PDrefl_q.enabled = False
kat
.
ETM
.
phi
=
result
[
'
phi_tuned
'
]
out
=
tilt
(
kat
)
...
...
@@ -62,25 +66,82 @@ def main():
def
tilt
(
tmpkat
):
def
compute_tilt
(
tmpkat
):
kat
=
copy
.
deepcopy
(
tmpkat
)
out
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
# compute x range in meters
beamsize
=
out
[
"
w0y
"
][
0
,
0
]
xrange
=
beamsize
*
(
out
.
x
.
max
()
-
out
.
x
.
min
())
stepsize
=
xrange
/
(
len
(
out
.
x
)
-
1
)
print
"
Beamsize %e m
"
%
beamsize
print
"
Measurement range: %e m, stepszie: %e m
"
%
(
xrange
,
stepsize
)
# compute difference in angle between wavefront of carrier and sidebands
diff_l
=
(
out
[
"
PDrefl_low
"
][:,
1
]
-
out
[
"
PDrefl_car
"
][:,
1
])
/
stepsize
diff_u
=
(
out
[
"
PDrefl_up
"
][:,
1
]
-
out
[
"
PDrefl_car
"
][:,
1
])
/
stepsize
tilt_l
=
diff_l
[
1
:
-
1
]
-
diff_l
[
0
:
-
2
]
tilt_u
=
diff_u
[
1
:
-
1
]
-
diff_u
[
0
:
-
2
]
print
"
Tilt (upper - car), mean: %e m/deg, stddev %e m/deg
"
%
(
np
.
mean
(
tilt_u
),
np
.
std
(
tilt_u
))
print
"
Tilt (lower - car), mean: %e m/deg, stddev %e m/deg
"
%
(
np
.
mean
(
tilt_l
),
np
.
std
(
tilt_l
))
return
(
np
.
mean
(
tilt_l
),
np
.
mean
(
tilt_u
))
kat
=
copy
.
deepcopy
(
tmpkat
)
code_det
=
"""
attr ITM ybeta 0.1n
code_WFS1
=
"""
beam PDrefl_car 0 nWFS1
beam PDrefl_up 9M nWFS1
beam PDrefl_low -9M nWFS1
bp w0y y w0 nWFS1
"""
code_WFS2
=
"""
beam PDrefl_car 0 nWFS2
beam PDrefl_up 9M nWFS2
beam PDrefl_low -9M nWFS2
bp w0y y w0 nWFS2
"""
code_comm
=
"""
xaxis PDrefl_car y lin -1 1 100
put PDrefl_up y $x1
put PDrefl_low y $x1
yaxis abs:deg
"""
kat
.
parseKatCode
(
code_det
)
kat
.
noxaxis
=
True
#kat.PDrefl_p.enabled = False
#kat.PDrefl_q.enabled = False
print
"
WFS1:
"
print
"
ITM ybeta 0.1nm
"
kat
.
parseKatCode
(
code_comm
)
kat
.
parseKatCode
(
code_WFS1
)
kat
.
ITM
.
ybeta
=
1e-10
kat
.
ETM
.
ybeta
=
0.0
out
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
#tilt_l = out.y[0]
#tilt_u = out.y[0]
(
a1
,
a2
)
=
compute_tilt
(
kat
)
print
"
ETM ybeta 0.1nm
"
kat
.
ITM
.
ybeta
=
0.0
kat
.
ETM
.
ybeta
=
1e-10
(
a3
,
a4
)
=
compute_tilt
(
kat
)
print
"
WFS2:
"
print
"
ITM ybeta 0.1nm
"
kat
=
copy
.
deepcopy
(
tmpkat
)
kat
.
parseKatCode
(
code_comm
)
kat
.
parseKatCode
(
code_WFS2
)
kat
.
ITM
.
ybeta
=
1e-10
kat
.
ETM
.
ybeta
=
0.0
(
a5
,
a6
)
=
compute_tilt
(
kat
)
print
"
ETM ybeta 0.1nm
"
kat
.
ITM
.
ybeta
=
0.0
kat
.
ETM
.
ybeta
=
1e-10
(
a6
,
a7
)
=
compute_tilt
(
kat
)
out
=
{}
return
(
out
)
#return (tilt_l, tilt_u)
...
...
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