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

generating kat files for the different PI setups and collecting tools used to tune these

parent 6627a41c
Branches
No related tags found
No related merge requests found
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib.pyplot as plt
import numpy as np
from pykat import finesse
from pykat.commands import *
import pykat.gw_detectors.ifo as ifo
def main():
"""
File to generate kat objects from the core aLIGO
file, ready for manual tuning.
Anna G 04.01.17
"""
global kat,out,LIGO1
LIGO1 = ifo.aLIGO(debug=True)
kat=LIGO1.kat
kat.verbose=True
## the full DR file
DRkat=kat.deepcopy()
DRkat.saveScript("raw/PI-DRMi.kat")
## the usual builddown files
kat = DRkat.deepcopy()
#PR
ifo.make_transparent(kat,["SRM","SRMAR"])
kat.cavSRX.remove()
kat.cavSRY.remove() #didn't do this before...necessary/different?
kat.saveScript("raw/PI-PRMi.kat")
#FP
ifo.make_transparent(kat,["PRM","PRMAR"])
kat.cavPRX.remove()
kat.cavPRY.remove()
kat.saveScript("raw/PI-FPMi.kat")
#1arm
ifo.make_transparent(kat,["ETMY","ITMY","ETMYAR","ITMYAR"])
kat.cavYARM.remove()
kat.saveScript("raw/PI-Xarm.kat")
## buildding down with 1 arm removed first
kat = DRkat.deepcopy()#returning to the built up version
#1arm, DR
ifo.make_transparent(kat,["ETMY","ITMY","ETMYAR","ITMYAR"])
kat.cavYARM.remove()
kat.saveScript("raw/PI-noY-DRMi.kat")
# PR
ifo.make_transparent(kat,["SRM","SRMAR"])
kat.cavSRX.remove()
kat.cavSRY.remove()
kat.saveScript("raw/PI-noY-PRMi.kat")
# Michelson
ifo.make_transparent(kat,["PRM","PRMAR"])
kat.cavPRX.remove()
kat.cavPRY.remove()
kat.saveScript("raw/PI-noY-FPMi.kat")#should be identical to PI-Xarm.kat
if __name__ == '__main__':
main()
\ No newline at end of file
from pykat import finesse
from pykat.commands import *
import pykat.gw_detectors.ifo as ifo
from tune_tools import *
def main():
########################
katfile = "DRMi"
########################
# LIGO1 = ifo.aLIGO(debug=True)
kat = finesse.kat()
kat.verbose=False
kat.loadKatFile("raw/PI-"+katfile+".kat") #locks fail. compare to original aLIGO kat.
kat.maxtem = 'off'#0
kat.phase = 2
################################################
DRkat = DRMi_tuning(kat,debug=True) #locks fail. compare to testLIGO.
print(DRkat)
# kat.verbose=True
## make own of these so not stuck with DRMi and locked
LIGO1.plot_error_signals(DRkat, xlimits=[-1e-2, 1e-2])
locks = ["ETMX_lock", "ETMY_lock", "PRCL_lock", "MICH_lock", "ITMY_lock", "SRCL_lock"]
test_locks(DRkat,locks)
################################################
# kat.saveScript("tuned/PI-"+katfile+".kat")
def test_locks(_kat,locks):
kat = _kat.deepcopy()
# test lock with BS tuning
code = """
xaxis BS phi lin 0 2 100
yaxis abs
#showiterate -1
"""
kat.parseCommands(code)
out = kat.run()
plt.figure()
ifo.make_list_copy(locks)
for l in locks:
plt.plot(out.x,out[l], label=l)
plt.legend()
plt.show()
# check f1 resonance in PRC
kat = _kat.deepcopy()
LIGO1.check_f1_PRC_resonance(kat)
if __name__ == '__main__':
main()
\ No newline at end of file
# Collection of tools used to ~manually tune the different kat objects.
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib.pyplot as plt
import numpy as np
from pykat import finesse
from pykat.commands import *
import pykat.gw_detectors.ifo as ifo
LIGO1 = ifo.aLIGO(debug=True)
def DRMi_tuning(_kat,debug=False):
# simplified from Andreas' TestLIGO file
kat = _kat.deepcopy()
kat.removeBlock('locks')
kat.removeBlock('errsigs')
kat.removeBlock('powers')
#pretuning and DC offset
pretune(kat, verbose=True, debug=False)
LIGO1.pretune_status(kat)
LIGO1.lengths_status(kat)
DCoffset = 20e-12 / kat.lambda0 * 180.0 # 20 pm
LIGO1.set_DC_offset(kat, DCoffset=DCoffset, verbose=True)
LIGO1.plot_error_signals(kat, xlimits=[-1e-2, 1e-2])
#locks
kat_lock = prepare_locks(kat, verbose=True)
kat_lock.noxaxis = True
kat_lock.verbose = True
out = kat_lock.run()
LIGO1.apply_lock_feedback(kat_lock, out)
if debug==True:
kat_check = kat_lock.deepcopy()
# test lock with BS tuning
code = """
xaxis BS phi lin 0 2 100
yaxis abs
#showiterate -1
"""
kat_check.parseCommands(code)
out = kat_check.run()
plt.figure()
locks = ["ETMX_lock", "ETMY_lock", "PRCL_lock", "MICH_lock", "ITMY_lock", "SRCL_lock"]
for l in locks:
plt.plot(out.x,out[l], label=l)
plt.legend()
plt.show()
# check f1 resonance in PRC
kat_check = kat_lock.deepcopy()
LIGO1.check_f1_PRC_resonance(kat_check)
return kat_lock
def pretune(kat, verbose=False, debug=False):
# from Andreas' TestLIGO file
kat_pretune = kat.deepcopy()
ifo.remove_components(kat_pretune, ["mod1", "lmod2", "mod2", "lmod3"], component_in="lmod1");
LIGO1.pretune(kat_pretune, verbose=verbose, pretune_precision=1.0e-4)
pretuning = LIGO1.get_tunings(kat_pretune)
if debug:
LIGO1.plot_pretuning_powers(kat_pretune, xlimits=[-.1, .1])
LIGO1.set_tunings(kat, pretuning)
# adjusting length of PRC and SRC versus mod frequencies
LIGO1.adjust_PRC_length(kat, verbose=verbose)
if debug:
LIGO1.check_f1_PRC_resonance(kat)
def prepare_locks(_kat, DCoffset=None, verbose=False):
# from Andreas' TestLIGO file
kat = _kat.deepcopy()
print("-- preparing block with lock commands")
code = LIGO1.generate_errsig_block(kat, noplot=True)
kat.parseCommands(code)
code = LIGO1.generate_locks(kat, verbose=True)
code = LIGO1.generate_lock_block(kat, verbose=True)
kat.parseCommands(code)
return kat
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment