Commit 420fd156 authored by Daniel Brown's avatar Daniel Brown

Updating aplus files

parent fb69b20b
......@@ -343,7 +343,8 @@ class cavity(Command):
base: The kat object to do the tracing with
"""
kat = self._kat.deepcopy()
kat.maxtem = 0 # always need a maxtem
for cav in kat.getAll(pykat.commands.cavity):
if self.name != cav.name:
cav.remove()
......@@ -357,7 +358,7 @@ class cavity(Command):
kat.parse("pd p %s" % self.__n1)
_, T = kat.run(getTraceData=True)
qx, qy, _ = T[0][node]
qx, qy, _ = T[0][str(node)]
return qx, qy
......
......@@ -1551,13 +1551,13 @@ class Output(object):
_nodes = zip(self.__nodeNames, self.__alternate_node_name)
else:
_nodes = self.__nodeNames
for nodes in _nodes:
if all([_.strip('* ') in self.__IFO.kat.nodes for _ in nodes]):
self.nodeName = nodes
break
if self.nodeName==None:
if self.nodeName is None:
raise pkex.BasePyKatException("port {}: cannot find any of these nodes: '{}'".format(self.name, self.__nodeNames))
......
......@@ -834,13 +834,15 @@ def make_kat(name="design", katfile=None, verbose = False, debug=False, use_RF_D
# If we don't have an OMC then we need to attach
# directly to the AS node. Otherwise use OMC refl
if "OMC" in kat.getBlocks():
nAS_RF = ["nOMC_ICb","nAS"] # Output() class accepts list of node names and match to the first one it finds
alt_nAS = "nAS"
nAS_RF = "nOMC_ICb"
else:
alt_nAS = None
nAS_RF = "nAS"
kat.IFO.AS_f1 = Output(kat.IFO, "AS_f1", nAS_RF, "f1", phase=101)
kat.IFO.AS_f2 = Output(kat.IFO, "AS_f2", nAS_RF, "f2", phase=14)
kat.IFO.AS_f36 = Output(kat.IFO, "AS_f36", nAS_RF, "f36M", phase=14)
kat.IFO.AS_f1 = Output(kat.IFO, "AS_f1", nAS_RF, "f1", phase=101, alternate_node_name=alt_nAS)
kat.IFO.AS_f2 = Output(kat.IFO, "AS_f2", nAS_RF, "f2", phase=14, alternate_node_name=alt_nAS)
kat.IFO.AS_f36 = Output(kat.IFO, "AS_f36", nAS_RF, "f36M", phase=14, alternate_node_name=alt_nAS)
kat.IFO.AS_DC = Output(kat.IFO, "AS_DC", "nAS")
kat.IFO.POW_BS = Output(kat.IFO, "PowBS", "nPRBS*")
......
......@@ -404,11 +404,11 @@ def strain_sensitivity(base,lower=10,upper=5000,steps=100, ax=None, plot_cmds={}
kat.parse(kat.IFO.DARM_h.transfer())
if kat.IFO.DARM_h.port.f is None:
kat.parse("qnoisedS NSR 1 $fs {node}".format(node=kat.IFO.DARM_h.port.nodeName))
kat.parse("qnoisedS NSR 1 $fs {node}".format(node=kat.IFO.DARM_h.port.nodeName[0]))
else:
kat.parse("qnoisedS NSR 2 {f} {phi} $fs {node}".format(f=kat.IFO.DARM_h.port.f,
phi=kat.IFO.DARM_h.port.phase,
node=kat.IFO.DARM_h.port.nodeName))
node=kat.IFO.DARM_h.port.nodeName[0]))
if ax is None:
ax = plt.subplot(111)
......
......@@ -244,8 +244,13 @@ class APLUS_IFO(IFO):
self.kat.nodes.replaceNode(self.kat.sHAM2in, 'nIMCout', 'nLaserOut')
if removeHAM2:
L = self.kat.sFI_IM3.L + self.kat.sIM3_IM4.L + self.kat.sPRCin.L
self.kat.removeBlock("HAM2")
self.kat.nodes.replaceNode(self.kat.sPRCin, 'nHAM2out', 'nLaserOut')
self.kat.parse("""
s sPRCin 0 nLaserOut nFI1
dbs FI nFI1 nFI2 nFI3 nREFL
s sFI_PRM {} nFI3 nPRM1
""".format(L), addToBlock='PRC')
def adjust_PRC_length(self, verbose=False):
......@@ -647,6 +652,8 @@ def make_kat(katfile=None, verbose=False, debug=False,
kat.IFO.update()
kat.IFO.lockNames = None
kat.noxaxis = True
return kat
......@@ -866,7 +873,7 @@ def pretune_status(_kat):
tunings = kat.IFO.get_tunings()
if tunings['keys']["maxtem"] == -1:
if tunings['keys']["maxtem"] is None or tunings['keys']["maxtem"] == -1:
_maxtemStr="off"
else:
_maxtemStr = "{}".format(tunings['keys']["maxtem"])
......
......@@ -405,11 +405,11 @@ def strain_sensitivity(base,lower=10,upper=5000,steps=100, ax=None, plot_cmds={}
if kat.IFO.DARM_h.port.num_nodes == 1:
if kat.IFO.DARM_h.port.f is None:
kat.parse("qnoisedS NSR 1 $fs {node}".format(node=kat.IFO.DARM_h.port.nodeName))
kat.parse("qnoisedS NSR 1 $fs {node}".format(node=kat.IFO.DARM_h.port.nodeName[0]))
else:
kat.parse("qnoisedS NSR 2 {f} {phi} $fs {node}".format(f=kat.IFO.DARM_h.port.f,
phi=kat.IFO.DARM_h.port.phase,
node=kat.IFO.DARM_h.port.nodeName))
node=kat.IFO.DARM_h.port.nodeName[0]))
else:
kat.parse("qhdS NSR 180 {} {}".format(*kat.IFO.DARM_h.port.nodeName))
......
Markdown is supported
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