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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
a439e44b
Commit
a439e44b
authored
Dec 16, 2013
by
Daniel Brown
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat
Conflicts: pykat/finesse.py
parents
4931aa4e
5a585425
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/asc_test/master.py
+27
-0
27 additions, 0 deletions
examples/asc_test/master.py
pykat/finesse.py
+10
-9
10 additions, 9 deletions
pykat/finesse.py
with
37 additions
and
9 deletions
examples/asc_test/master.py
+
27
−
0
View file @
a439e44b
from
pykat
import
finesse
from
pykat
import
finesse
from
pykat.commands
import
*
from
pykat.commands
import
*
import
pylab
as
pl
import
pylab
as
pl
import
copy
print
"""
print
"""
--------------------------------------------------------------
--------------------------------------------------------------
...
@@ -23,6 +24,8 @@ kat = finesse.kat(tempdir=".",tempname="test")
...
@@ -23,6 +24,8 @@ kat = finesse.kat(tempdir=".",tempname="test")
kat
.
verbose
=
False
kat
.
verbose
=
False
kat
.
loadKatFile
(
'
asc_base.kat
'
)
kat
.
loadKatFile
(
'
asc_base.kat
'
)
kat
.
maxtem
=
3
kat
.
maxtem
=
3
Lambda
=
1064.0e-9
print
"
--------------------------------------------------------
"
print
"
--------------------------------------------------------
"
print
"
1. tunes ETM position to find resonance
"
print
"
1. tunes ETM position to find resonance
"
...
@@ -39,6 +42,30 @@ print " 3. determine the optimal phase for the PDH signal"
...
@@ -39,6 +42,30 @@ print " 3. determine the optimal phase for the PDH signal"
import
asc_pd_phase
import
asc_pd_phase
(
p_phase
,
q_phase
)
=
asc_pd_phase
.
run
(
kat
)
(
p_phase
,
q_phase
)
=
asc_pd_phase
.
run
(
kat
)
# setting demodulation phase
code_det
=
"""
pd1 PDrefl_p 9M 0 nWFS1
scale 2 PDrefl_p
pd1 PDrefl_q 9M 90 nWFS1
scale 2 PDrefl_q
"""
kat
.
parseKatCode
(
code_det
)
kat
.
PDrefl_p
.
phi
[
0
]
=
p_phase
kat
.
PDrefl_q
.
phi
[
0
]
=
q_phase
print
"
--------------------------------------------------------
"
print
"
4. adding a 0.1nm offset to ETM and compute PDH signal
"
phi0
=
kat
.
ETM
.
phi
kat
.
ETM
.
phi
=
phi0
+
0.1
/
1064.0
*
360
print
"
new ETM phi tuning = %g
"
%
kat
.
ETM
.
phi
import
asc_pd_signal
(
pd_p
,
pd_q
)
=
asc_pd_signal
.
run
(
kat
)
print
"
PDH inphase = %e
"
%
pd_p
print
"
PDH quadrtature = %e
"
%
pd_q
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
10
−
9
View file @
a439e44b
...
@@ -146,7 +146,7 @@ class kat(object):
...
@@ -146,7 +146,7 @@ class kat(object):
self
.
__time_code
=
None
self
.
__time_code
=
None
if
kat_code
!=
None
and
kat_file
!=
None
:
if
kat_code
!=
None
and
kat_file
!=
None
:
raise
BasePyKatException
(
"
Specify either a Kat file or some Kat code, not both.
"
)
raise
pkex
.
BasePyKatException
(
"
Specify either a Kat file or some Kat code, not both.
"
)
if
kat_code
!=
None
:
if
kat_code
!=
None
:
self
.
parseCommands
(
kat_code
)
self
.
parseCommands
(
kat_code
)
...
@@ -179,8 +179,8 @@ class kat(object):
...
@@ -179,8 +179,8 @@ class kat(object):
def
logo
(
self
):
def
logo
(
self
):
print
"""
..-
print
"""
..-
_
'
(
PyKat
_
'
(
PyKat
\\
`.|
\\
.__...-
\"\"
""
-_.
"
)
\\
`.|
\\
.__...-
\"\"
""
-_.
"
)
..+-----.._ /
'
` .-
'
..+-----.._ /
'
` .-
'
.
'
`: 7/* _/._
\\
\\
(
.
'
`: 7/* _/._
\\
\\
(
(
'
::;;+;;: `-
"'
=
"
/,`
""
`) /
(
'
::;;+;;: `-
"'
=
"
/,`
""
`) /
...
@@ -305,7 +305,7 @@ class kat(object):
...
@@ -305,7 +305,7 @@ class kat(object):
katfile
.
flush
()
katfile
.
flush
()
katfile
.
close
()
katfile
.
close
()
except
BasePyKatException
as
ex
:
except
pkex
.
BasePyKatException
as
ex
:
print
ex
print
ex
def
run
(
self
,
printout
=
0
,
printerr
=
0
,
save_output
=
False
,
save_kat
=
False
,
kat_name
=
None
)
:
def
run
(
self
,
printout
=
0
,
printerr
=
0
,
save_output
=
False
,
save_kat
=
False
,
kat_name
=
None
)
:
...
@@ -314,6 +314,8 @@ class kat(object):
...
@@ -314,6 +314,8 @@ class kat(object):
It returns a katRun or katRun2D object which is populated with the various
It returns a katRun or katRun2D object which is populated with the various
data from the simulation run.
data from the simulation run.
"""
"""
start
=
datetime
.
datetime
.
now
()
try
:
try
:
if
not
hasattr
(
self
,
"
xaxis
"
)
and
self
.
noxaxis
!=
None
and
self
.
noxaxis
==
False
:
if
not
hasattr
(
self
,
"
xaxis
"
)
and
self
.
noxaxis
!=
None
and
self
.
noxaxis
==
False
:
...
@@ -343,7 +345,6 @@ class kat(object):
...
@@ -343,7 +345,6 @@ class kat(object):
raise
MissingFinesse
()
raise
MissingFinesse
()
print
"
--------------------------------------------------------------
"
print
"
--------------------------------------------------------------
"
start
=
datetime
.
datetime
.
now
()
print
"
Running kat - Started at
"
+
str
(
start
)
print
"
Running kat - Started at
"
+
str
(
start
)
if
hasattr
(
self
,
"
x2axis
"
):
if
hasattr
(
self
,
"
x2axis
"
):
...
@@ -483,7 +484,7 @@ class kat(object):
...
@@ -483,7 +484,7 @@ class kat(object):
if
isinstance
(
obj
,
Component
):
if
isinstance
(
obj
,
Component
):
if
obj
.
name
in
self
.
__components
:
if
obj
.
name
in
self
.
__components
:
raise
BasePyKatException
(
"
A component with name
'
{0}
'
has already been added
"
.
format
([
obj
.
name
]))
raise
pkex
.
BasePyKatException
(
"
A component with name
'
{0}
'
has already been added
"
.
format
([
obj
.
name
]))
self
.
__components
[
obj
.
name
]
=
obj
self
.
__components
[
obj
.
name
]
=
obj
self
.
__add_component
(
obj
)
self
.
__add_component
(
obj
)
...
@@ -491,7 +492,7 @@ class kat(object):
...
@@ -491,7 +492,7 @@ class kat(object):
elif
isinstance
(
obj
,
Detector
):
elif
isinstance
(
obj
,
Detector
):
if
obj
.
name
in
self
.
__detectors
:
if
obj
.
name
in
self
.
__detectors
:
raise
BasePyKatException
(
"
A detector
'
{0}
'
has already been added
"
.
format
(
obj
.
name
))
raise
pkex
.
BasePyKatException
(
"
A detector
'
{0}
'
has already been added
"
.
format
(
obj
.
name
))
self
.
__detectors
[
obj
.
name
]
=
obj
self
.
__detectors
[
obj
.
name
]
=
obj
self
.
__add_detector
(
obj
)
self
.
__add_detector
(
obj
)
...
...
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