Skip to content
Snippets Groups Projects
Commit 6dbf518e authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

simplify suspension type handling by using string names

ifo.Suspension.Type now accepts string for suspension calc func, e.g. 'Quad'
for 'suspQuad' calc.
parent 04276b3e
No related branches found
No related tags found
No related merge requests found
......@@ -13,16 +13,14 @@ def noise_calc(ifo, f):
"""Calculate all IFO noises and return as dict
"""
##############################
# suspension transfer functions
#
# this needs to be done here, instead of in precompIFO, because it
# requires the frequency vector
# quad cases, for backward compatability
if ifo.Suspension.Type in (0, 1, 2):
hForce, vForce, hTable, vTable = noise.suspensionthermal.suspQuad(f, ifo)
elif ifo.Suspension.Type == 'Quad':
ifo.Suspension.Type = 0
hForce, vForce, hTable, vTable = noise.suspensionthermal.suspQuad(f, ifo)
else:
fname = noise.suspensionthermal.__dict__['susp' + str(ifo.Suspension.Type)]
hForce, vForce, hTable, vTable = fname(f, ifo)
fname = eval('noise.suspensionthermal.susp{}'.format(ifo.Suspension.Type))
hForce, vForce, hTable, vTable = fname(f, ifo)
# if the suspension code supports different temps for the stages
try:
......
......@@ -70,9 +70,7 @@ Seismic:
Omicron: 1 # Feedforward cancellation factor
Suspension:
# 0 for cylindrical suspension
#Type: 'Quad'
Type: 2
Type: 'Quad'
# 0: round, 1: ribbons, 2: tapered
FiberType: 2
BreakStress: 750e6 # Pa; ref. K. Strain
......
......@@ -79,7 +79,7 @@ Seismic:
#darmSeiSusFile: 'CryogenicLIGO/Sensitivity/GWINC/seismic.mat'
Suspension:
Type: 'BQuad' # 0 for cylindrical suspension
Type: 'BQuad'
# Suspension fiber temperatures [TOP UIM PUM TST]
Temp:
- 300.0
......
......@@ -68,9 +68,7 @@ Seismic:
Omicron: 1 # Feedforward cancellation factor
Suspension:
# 0 for cylindrical suspension
#Type: 'Quad'
Type: 2
Type: 'Quad'
# 0: round, 1: ribbons
FiberType: 0
BreakStress: 750e6 # Pa; ref. K. Strain
......
......@@ -6,10 +6,13 @@ from scipy.io.matlab.mio5_params import mat_struct
def suspR(f, ifo):
"""Thermal noise for quadruple pendulum
switches to various suspension types based on ifo.Suspension.Type
the general case calls the suspTYPE function to generate TFs"""
"""Suspention thermal noise.
Assumes suspension transfer functions and V-H coupling have been
pre-calculated and populated into the relevant `ifo` struct
fields.
"""
# Assign Physical Constants
kB = scipy.constants.k
Temp = ifo.Suspension.Temp
......@@ -65,18 +68,9 @@ def suspR(f, ifo):
w = 2*pi*f
noise += 4 * kB * Temp[ii] * abs(imag(dxdF[ii,:])) / w
if ifo.Suspension.Type == 'Quad_MB':
raise Exception('not dealing with Quad_MB suspensions currently')
#mbquadlite2lateral_20090819TM_TN;
#tvec = sqrt(xvec.^2 + (1e-3*zvec).^2);
#tvec = tvec*2; % 4 masses
#nn.SuspThermalB = interp1(fvec, tvec, f, [], 0);
#noise = nn.SuspThermalB/ifo.Infrastructure.Length; % convert to strain
#noise = noise.^2; %square to make strain^2
else:
# turn into gravitational wave strain; 4 masses
noise *= 4 / ifo.Infrastructure.Length**2
return np.squeeze(noise)
# 4 masses, turn into gravitational wave strain
noise *= 4 / ifo.Infrastructure.Length**2
return np.squeeze(noise)
def suspBQuad(f, ifo):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment