Commit 665695c0 authored by Andreas Freise's avatar Andreas Freise
Browse files

adding gainsAdjustment factors part of the function call for lock blocks

parent 0fc6478c
Pipeline #1748 passed with stage
in 19 seconds
...@@ -39,13 +39,13 @@ class aLIGO(object): ...@@ -39,13 +39,13 @@ class aLIGO(object):
""" """
def __init__(self, _name="default", katfile=None, debug=False): def __init__(self, _name="default", katfile=None, verbose = False, debug=False):
names = ['default', 'LLO', 'LHO'] names = ['default', 'LLO', 'LHO']
if debug: if debug:
self.kat = finesse.kat(tempdir=".",tempname="test") self.kat = finesse.kat(tempdir=".",tempname="test")
else: else:
self.kat = finesse.kat() self.kat = finesse.kat()
self.kat.verbose=verbose
if katfile: if katfile:
self.kat.loadKatFile(katfile) self.kat.loadKatFile(katfile)
else: else:
...@@ -507,11 +507,11 @@ class aLIGO(object): ...@@ -507,11 +507,11 @@ class aLIGO(object):
return code1 return code1
def generate_lock_block(self, _kat, _gains=None, _accuracies=None, verbose=True): def generate_lock_block(self, _kat, gainsAdjustment = [0.5, 0.005, 1.0, 0.5, 0.025], gains=None, accuracies=None, verbose=True):
""" """
gains: optical gain is in W per deg gainsAdjustment: factors to apply to loop gains computed from optical gains
accuracies: error signal threshold in W gains: override loop gain [W per deg]
accuracies: overwrite error signal threshold [W]
""" """
kat = _kat.deepcopy() kat = _kat.deepcopy()
# optical gains in W/rad # optical gains in W/rad
...@@ -521,20 +521,16 @@ class aLIGO(object): ...@@ -521,20 +521,16 @@ class aLIGO(object):
ogMICH = optical_gain(kat, self.MICH, self.MICH) ogMICH = optical_gain(kat, self.MICH, self.MICH)
ogSRCL = optical_gain(kat, self.SRCL, self.SRCL) ogSRCL = optical_gain(kat, self.SRCL, self.SRCL)
if _gains == None: if gains == None:
# manually tuning relative gains # manually tuning relative gains
gainExtra = [0.5, 0.005, 1.0, 0.5, 0.025]
factor = -1.0 * 180 / math.pi # convert from rad/W to -1 * deg/W factor = -1.0 * 180 / math.pi # convert from rad/W to -1 * deg/W
gainDARM = round_to_n(gainExtra[0] * factor / ogDARM, 2) # manually tuned gainDARM = round_to_n(gainsAdjustment[0] * factor / ogDARM, 2) # manually tuned
gainCARM = round_to_n(gainExtra[1] * factor / ogCARM, 2) # factor 0.005 for better gain hirarchy with DARM gainCARM = round_to_n(gainsAdjustment[1] * factor / ogCARM, 2) # factor 0.005 for better gain hirarchy with DARM
gainPRCL = round_to_n(gainExtra[2] * factor / ogPRCL, 2) # manually tuned gainPRCL = round_to_n(gainsAdjustment[2] * factor / ogPRCL, 2) # manually tuned
gainMICH = round_to_n(gainExtra[3] * factor / ogMICH, 2) # manually tuned gainMICH = round_to_n(gainsAdjustment[3] * factor / ogMICH, 2) # manually tuned
gainSRCL = round_to_n(gainExtra[4] * factor / ogSRCL, 2) # gain hirarchy with MICH gainSRCL = round_to_n(gainsAdjustment[4] * factor / ogSRCL, 2) # gain hirarchy with MICH
gains = [ gainDARM, gainCARM, gainPRCL, gainMICH, gainSRCL] gains = [ gainDARM, gainCARM, gainPRCL, gainMICH, gainSRCL]
else:
gains = _gains.copy()
# rms: loop accuracies in meters (manually tuned for the loops to work # rms: loop accuracies in meters (manually tuned for the loops to work
# with the default file) # with the default file)
# to compute accuracies from rms, we convert # to compute accuracies from rms, we convert
...@@ -542,15 +538,13 @@ class aLIGO(object): ...@@ -542,15 +538,13 @@ class aLIGO(object):
# and then multiply by the optical gain. # and then multiply by the optical gain.
rms = [1e-13, 1e-13, 1e-12, 1e-11, 50e-11] # default accuracies in meters rms = [1e-13, 1e-13, 1e-12, 1e-11, 50e-11] # default accuracies in meters
factor = 2.0 * math.pi / kat.lambda0 # convert from m to radians factor = 2.0 * math.pi / kat.lambda0 # convert from m to radians
if _accuracies == None: if accuracies == None:
accDARM = round_to_n(np.abs(factor * rms[0] * ogDARM),2) accDARM = round_to_n(np.abs(factor * rms[0] * ogDARM),2)
accCARM = round_to_n(np.abs(factor * rms[1] * ogCARM),2) accCARM = round_to_n(np.abs(factor * rms[1] * ogCARM),2)
accPRCL = round_to_n(np.abs(factor * rms[2] * ogPRCL),2) accPRCL = round_to_n(np.abs(factor * rms[2] * ogPRCL),2)
accMICH = round_to_n(np.abs(factor * rms[3] * ogMICH),2) accMICH = round_to_n(np.abs(factor * rms[3] * ogMICH),2)
accSRCL = round_to_n(np.abs(factor * rms[4] * ogSRCL),2) accSRCL = round_to_n(np.abs(factor * rms[4] * ogSRCL),2)
acc = [accDARM, accCARM, accPRCL, accMICH, accSRCL] accuracies = [accDARM, accCARM, accPRCL, accMICH, accSRCL]
else:
acc = _accuracies.copy()
nameDARM = self.DARM.signal_name(kat) nameDARM = self.DARM.signal_name(kat)
nameCARM = self.CARM.signal_name(kat) nameCARM = self.CARM.signal_name(kat)
...@@ -572,7 +566,7 @@ class aLIGO(object): ...@@ -572,7 +566,7 @@ class aLIGO(object):
lock CARM_lock $CARM_err {:8.2g} {:8.2g} lock CARM_lock $CARM_err {:8.2g} {:8.2g}
lock PRCL_lock $PRCL_err {:8.2g} {:8.2g} lock PRCL_lock $PRCL_err {:8.2g} {:8.2g}
lock MICH_lock $MICH_err {:8.2g} {:8.2g} lock MICH_lock $MICH_err {:8.2g} {:8.2g}
lock SRCL_lock $SRCL_err {:8.2g} {:8.2g}""".format(gains[0], acc[0], gains[1], acc[1], gains[2], acc[2], gains[3], acc[3], gains[4], acc[4]) lock SRCL_lock $SRCL_err {:8.2g} {:8.2g}""".format(gains[0], accuracies[0], gains[1], accuracies[1], gains[2], accuracies[2], gains[3], accuracies[3], gains[4], accuracies[4])
code3 = """ code3 = """
noplot ITMY_lock noplot ITMY_lock
...@@ -622,11 +616,11 @@ lock SRCL_lock $SRCL_err {:8.2g} {:8.2g}""".format(gains[0], acc[0], gains[1], a ...@@ -622,11 +616,11 @@ lock SRCL_lock $SRCL_err {:8.2g} {:8.2g}""".format(gains[0], acc[0], gains[1], a
print(" | SRCL: {:12.6}, {:12.6}, {:12.6} |".format(factor3*rms[4], rms[4], np.abs(rms[4]*ogSRCL*factor2))) print(" | SRCL: {:12.6}, {:12.6}, {:12.6} |".format(factor3*rms[4], rms[4], np.abs(rms[4]*ogSRCL*factor2)))
print(" +--------------------------------------------------+") print(" +--------------------------------------------------+")
print(" | -- extra gain factors (factor * 1/optical_gain): |") print(" | -- extra gain factors (factor * 1/optical_gain): |")
print(" | DARM: {:5.4} * {:12.6} = {:12.6} |".format(gainExtra[0],factor4/ogDARM, gainExtra[0]*factor4/ogDARM)) print(" | DARM: {:5.4} * {:12.6} = {:12.6} |".format(gainsAdjustment[0],factor4/ogDARM, gainsAdjustment[0]*factor4/ogDARM))
print(" | CARM: {:5.4} * {:12.6} = {:12.6} |".format(gainExtra[1],factor4/ogCARM, gainExtra[1]*factor4/ogCARM)) print(" | CARM: {:5.4} * {:12.6} = {:12.6} |".format(gainsAdjustment[1],factor4/ogCARM, gainsAdjustment[1]*factor4/ogCARM))
print(" | PRCL: {:5.4} * {:12.6} = {:12.6} |".format(gainExtra[2],factor4/ogPRCL, gainExtra[2]*factor4/ogPRCL)) print(" | PRCL: {:5.4} * {:12.6} = {:12.6} |".format(gainsAdjustment[2],factor4/ogPRCL, gainsAdjustment[2]*factor4/ogPRCL))
print(" | MICH: {:5.4} * {:12.6} = {:12.6} |".format(gainExtra[3],factor4/ogMICH, gainExtra[3]*factor4/ogMICH)) print(" | MICH: {:5.4} * {:12.6} = {:12.6} |".format(gainsAdjustment[3],factor4/ogMICH, gainsAdjustment[3]*factor4/ogMICH))
print(" | SRCL: {:5.4} * {:12.6} = {:12.6} |".format(gainExtra[4],factor4/ogSRCL, gainExtra[4]*factor4/ogSRCL)) print(" | SRCL: {:5.4} * {:12.6} = {:12.6} |".format(gainsAdjustment[4],factor4/ogSRCL, gainsAdjustment[4]*factor4/ogSRCL))
print(" +--------------------------------------------------+") print(" +--------------------------------------------------+")
print(" | -- lock commands used: |") print(" | -- lock commands used: |")
for l in code2.splitlines(): for l in code2.splitlines():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment