Commit 9ab3e5d1 authored by Daniel Brown's avatar Daniel Brown

updating error signals plotting

parent 6716c81d
...@@ -819,19 +819,10 @@ def make_kat(name="design", katfile=None, verbose = False, debug=False, use_RF_D ...@@ -819,19 +819,10 @@ def make_kat(name="design", katfile=None, verbose = False, debug=False, use_RF_D
kat.IFO.POP_f2 = Output(kat.IFO, "POP_f2", "nPOP", "f2", phase=13) kat.IFO.POP_f2 = Output(kat.IFO, "POP_f2", "nPOP", "f2", phase=13)
kat.IFO.REFL_f1 = Output(kat.IFO, "REFL_f1", "nREFL", "f1", phase=101) kat.IFO.REFL_f1 = Output(kat.IFO, "REFL_f1", "nREFL", "f1", phase=101)
kat.IFO.REFL_f2 = Output(kat.IFO, "REFL_f2", "nREFL", "f2", phase=14) kat.IFO.REFL_f2 = Output(kat.IFO, "REFL_f2", "nREFL", "f2", phase=14)
# 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():
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, alternate_node_name=alt_nAS) kat.IFO.AS_f1 = Output(kat.IFO, "AS_f1", "nSRM2", "f1", phase=101)
kat.IFO.AS_f2 = Output(kat.IFO, "AS_f2", nAS_RF, "f2", phase=14, alternate_node_name=alt_nAS) kat.IFO.AS_f2 = Output(kat.IFO, "AS_f2", "nSRM2", "f2", phase=14)
kat.IFO.AS_f36 = Output(kat.IFO, "AS_f36", nAS_RF, "f36M", phase=14, alternate_node_name=alt_nAS) kat.IFO.AS_f36 = Output(kat.IFO, "AS_f36", "nSRM2", "f36M", phase=14)
kat.IFO.AS_DC = Output(kat.IFO, "AS_DC", "nAS") kat.IFO.AS_DC = Output(kat.IFO, "AS_DC", "nAS")
kat.IFO.POW_BS = Output(kat.IFO, "PowBS", "nPRBS*") kat.IFO.POW_BS = Output(kat.IFO, "PowBS", "nPRBS*")
......
...@@ -79,7 +79,8 @@ def pretuning_powers(self, _kat, xlimits=[-10,10]): ...@@ -79,7 +79,8 @@ def pretuning_powers(self, _kat, xlimits=[-10,10]):
plt.show(block=0) plt.show(block=0)
def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None, def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None,
replaceDOFSignals=False, block=True, fig=None, label=None, steps=100): replaceDOFSignals=False, block=True, fig=None, label=None, steps=100,
verbose=False):
""" """
Displays error signals for a given kat file. Can also be used to plot multiple Displays error signals for a given kat file. Can also be used to plot multiple
DOF's error signals against each other for visualising any cross coupling. DOF's error signals against each other for visualising any cross coupling.
...@@ -92,7 +93,8 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None, ...@@ -92,7 +93,8 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None,
replaceDOFSignals: Bool, replaces already present signals for any DOF if already defined in kat. Regardless of this value, it will add default signals if none found. replaceDOFSignals: Bool, replaces already present signals for any DOF if already defined in kat. Regardless of this value, it will add default signals if none found.
fig: figure, uses predefined figure, when defined it won't be shown automatically fig: figure, uses predefined figure, when defined it won't be shown automatically
label: string, if no plotDOFs is defined this legend is shown label: string, if no plotDOFs is defined this legend is shown
verbose: prints more output about what's happening, e.g. what commands are getting added
Example: Example:
import pykat import pykat
from pykat.gw_detectors import ifo from pykat.gw_detectors import ifo
...@@ -119,7 +121,9 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None, ...@@ -119,7 +121,9 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None,
# add in signals for those DOF to plot # add in signals for those DOF to plot
for _ in dofs: for _ in dofs:
if replaceDOFSignals and not hasattr(kat, _.signal_name()): if replaceDOFSignals:
if verbose:
print(_.name, "PD COMMAND", _.signal())
kat.parse(_.signal()) kat.parse(_.signal())
toShow = None toShow = None
...@@ -161,7 +165,8 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None, ...@@ -161,7 +165,8 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None,
scan_cmd = scan_optics_string(d.optics, d.factors, "scan", linlog="lin", scan_cmd = scan_optics_string(d.optics, d.factors, "scan", linlog="lin",
xlimits=np.multiply(d.scale, xlimits), steps=steps, xlimits=np.multiply(d.scale, xlimits), steps=steps,
axis=1, relative=True) axis=1, relative=True)
if verbose:
print(d.name, "SCAN COMMAND", scan_cmd)
kat.parse(scan_cmd, addToBlock="SCAN") kat.parse(scan_cmd, addToBlock="SCAN")
out = kat.run(cmd_args=['-cr=on']) out = kat.run(cmd_args=['-cr=on'])
...@@ -187,7 +192,7 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None, ...@@ -187,7 +192,7 @@ def error_signals(_kat, xlimits=[-1,1], DOFs=None, plotDOFs=None,
ax.set_xlabel("{} [deg]".format(d.name)) ax.set_xlabel("{} [deg]".format(d.name))
if plotDOFs is None: if plotDOFs is None:
ax.set_ylabel('{} [W] '.format(d.port.name)) ax.set_ylabel('{} {} [W] '.format(d.port.name, d.quad))
else: else:
ax.set_ylabel('Error signal [W]') ax.set_ylabel('Error signal [W]')
......
...@@ -12,7 +12,7 @@ text.usetex : False ...@@ -12,7 +12,7 @@ text.usetex : False
axes.grid : True axes.grid : True
axes.formatter.useoffset : False axes.formatter.useoffset : False
axes.formatter.use_locale : False axes.formatter.use_locale : False
axes.prop_cycle : cycler('color', ['0000FF', 'FF0000', '000000', '00FF00', 'FF00FF']) axes.prop_cycle : cycler('color', ['b', 'r', 'k', 'g', 'c', 'm', 'y'])
axes.axisbelow : True axes.axisbelow : True
axes.xmargin : 0 axes.xmargin : 0
......
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