Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aligo_finesse
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
aligo_finesse
Commits
6a4a40dd
Commit
6a4a40dd
authored
8 years ago
by
Anna Green
Browse files
Options
Downloads
Patches
Plain Diff
started add_detectors function
parent
0ed93018
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
playground/anna/file_review/zero_locks.py
+24
-2
24 additions, 2 deletions
playground/anna/file_review/zero_locks.py
with
24 additions
and
2 deletions
playground/anna/file_review/zero_locks.py
+
24
−
2
View file @
6a4a40dd
...
...
@@ -65,7 +65,7 @@ def main():
kat
.
maxtem
=
0
#'off'
# ## initial tuning
zero_locks
(
kat
)
pretune
(
kat
)
diagnostics
(
kat
)
# ## applying offset
...
...
@@ -84,7 +84,7 @@ def diagnostics(kat):
# plt.pause(5) # delay after plot (optional, may be useful with plt.ion())
# ag.plot_QNS(kat,plotit=True,show=True,unlock=True)
def
zero_locks
(
_kat
,
pretune_precision
=
1e-5
):
def
pretune
(
_kat
,
pretune_precision
=
1e-5
):
print
(
"""
PRETUNING:
----------------------------------------------
...
...
@@ -635,6 +635,28 @@ def plot_Powers(_kat,xscale=1,steps=200):
plt
.
show
()
def
add_detectors
(
_kat
,
node
,
det_type
=
'
pd
'
,
freqs
=
None
,
phases
=
None
,
tem
=
None
):
## or add_ad, add_pd, add_pd1, add_pd2?
## or add_errsig, add_TF, add_pd, add_fielddetector, add_networkanalyser
if
node
not
in
_kat
.
nodes
.
getNodes
():
raise
pkex
.
BasePyKatException
(
"
node {} not found in kat object.
"
)
supported
=
[
'
pd
'
]
#,'pd1','pd2','ad']
if
det_type
not
in
supported
:
raise
pkex
.
BasePyKatException
(
"
detector type {0} currently not supported. Must be one of {1}
"
.
format
(
det_type
,
supported
))
elif
det_type
==
'
pd
'
:
if
freqs
!=
None
or
phases
!=
None
or
tem
!=
None
:
print
(
"
NOTE: detector type
'
pd
'
selected. Ignoring tem commands and demodulation phases/freqencies
"
)
name
=
"
P_{}
"
.
format
(
node
)
_kat
.
parseCommands
(
"
pd {0} {1}
"
.
format
(
name
,
node
))
print
(
'
detector added. name: {}
'
.
format
(
name
))
# e.g. from plot_errsigs:
# detname = "{0}_Err".format(_dof)
# kat.parseCommands("pd1 {0} {1} {2} {3}".format(detname,demod_freq,demod_phase,node))
def
phi_tuning
(
deltam
,
lambda0
=
1064e-9
):
return
(
deltam
/
lambda0
)
*
360
...
...
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