Skip to content
Snippets Groups Projects
Commit 6a4a40dd authored by Anna Green's avatar Anna Green
Browse files

started add_detectors function

parent 0ed93018
Branches
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment