From 8492a0d3c93f9879b6f65bb3b105d01bab5ad82a Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins <jrollins@finestructure.net> Date: Thu, 30 Jan 2020 09:32:34 -0800 Subject: [PATCH] seismic code simplification susQuad function take sus Struct instead of full ifo --- gwinc/precomp.py | 2 +- gwinc/suspension.py | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gwinc/precomp.py b/gwinc/precomp.py index d89b2a0a..d9a616ef 100644 --- a/gwinc/precomp.py +++ b/gwinc/precomp.py @@ -120,7 +120,7 @@ def precompIFO(f, ifoin, PRfixed=True): # Suspension # if the suspension code supports different temps for the stages fname = eval('suspension.susp{}'.format(ifo.Suspension.Type)) - hForce, vForce, hTable, vTable = fname(f, ifo) + hForce, vForce, hTable, vTable = fname(f, ifo.Suspension) try: # full TF (conventional) diff --git a/gwinc/suspension.py b/gwinc/suspension.py index de11ccdb..b94ff026 100644 --- a/gwinc/suspension.py +++ b/gwinc/suspension.py @@ -67,14 +67,14 @@ def top_displ_to_tst_displ(k, m, f): return X0 * k0 -def suspQuad(f, ifo, material='Silica'): +def suspQuad(f, sus, material='Silica'): """Suspension for quadruple pendulum - `f` is frequency vector, `ifo` is IFO model. `material` specifies - material used for test mass suspension stage. steel used for all - other stages. Violin modes are included. + `f` is frequency vector, `sus` is suspension model. `material` + specifies material used for test mass suspension stage. steel + used for all other stages. Violin modes are included. - ifo.Suspension.FiberType should be: 0=round, 1=ribbons. + sus.FiberType should be: 0=round, 1=ribbons. hForce, vForce = transfer functions from the force on the TM to TM motion these should have the correct losses for the mechanical @@ -84,7 +84,7 @@ def suspQuad(f, ifo, material='Silica'): = hForce + theta^2 * vForce = admittance / (i * w) - where theta = ifo.Suspension.VHCoupling.theta. + where theta = sus.VHCoupling.theta. Since this is just suspension thermal noise, the TM internal modes and coating properties should not be included. @@ -101,8 +101,6 @@ def suspQuad(f, ifo, material='Silica'): """ g = const.g - sus = ifo.Suspension - # bottom stage fiber Type FiberType = sus.FiberType assert FiberType in FIBER_TYPES @@ -417,10 +415,10 @@ def suspQuad(f, ifo, material='Silica'): return hForce, vForce, hTable, vTable -def suspBQuad(f, ifo): +def suspBQuad(f, sus): """Wrapper of suspQuad to use Silicon for final stage - FIXME: material should be specified in ifo.Suspension.Stage + FIXME: material should be specified in sus.Stage """ - return suspQuad(f, ifo, material='Silicon') + return suspQuad(f, sus, material='Silicon') -- GitLab