Commit a118bdf5 authored by Lee McCuller's avatar Lee McCuller
Browse files

more BHD tests

parent 0d427a44
Pipeline #256194 failed with stages
in 2 minutes and 22 seconds
......@@ -15,4 +15,4 @@ Squeezer:
# Parameters for frequency dependent squeezing
FilterCavity:
fdetune: -48.0 # detuning [Hz]
fdetune: -49.0 # detuning [Hz]
......@@ -15,4 +15,4 @@ Squeezer:
# Parameters for frequency dependent squeezing
FilterCavity:
fdetune: -51.0 # detuning [Hz]
fdetune: -52.0 # detuning [Hz]
......@@ -15,4 +15,4 @@ Squeezer:
# Parameters for frequency dependent squeezing
FilterCavity:
fdetune: -52.0 # detuning [Hz]
fdetune: -54.0 # detuning [Hz]
......@@ -22,6 +22,37 @@ RANGE_PARAMS_BH = dict(m1=70, m2=70)
def test_Aplus_LO(pprint, tpath_join, fpath_join):
F_Hz = np.logspace(1, 3.5, 3000)
import h5py
hdf5 = h5py.File(fpath_join('contour.h5'), 'r')
figC = pyl.figure()
axC = figC.add_subplot(1, 1, 1)
extent = (
hdf5['fd'][0],
hdf5['fd'][-1],
hdf5['SQZ'][-1],
hdf5['SQZ'][0],
)
rel = hdf5['rangeNS'] / np.max(hdf5['rangeNS'])
pm = axC.imshow(
rel,
cmap = 'copper',
extent = extent,
)
CS = axC.contour(
hdf5['fd'], hdf5['SQZ'], rel,
levels = [.80, .9, .95, .99],
colors = ['black', 'blue', 'purple', 'red'],
#colors = [],
alpha = .7,
linewidths = 1,
)
axC.clabel(CS, inline=1, fontsize=8)
axC.set_aspect('auto')
axC.set_ylabel('Homodyne and SQZ angles [rad]')
axC.set_xlabel('Filter Cavity Detuning [Hz] \n using 1000ppm T_in')
figC.colorbar(pm, label = 'BNS 1.4/1.4Msol comoving inspiral range (relative max)')
budget_nom = gwinc.load_budget(fpath_join('Aplus.yaml'), freq = F_Hz)
traces_nom = budget_nom.run()
......@@ -33,7 +64,7 @@ def test_Aplus_LO(pprint, tpath_join, fpath_join):
ax_allrelQ = fig_all.add_subplot(gs[1, 1])
def plot_ifos(ifos):
for idx, (iname, kw1, kw2) in enumerate(ifos):
for idx, (iname, kw1) in enumerate(ifos):
if path.splitext(iname)[1]:
budgetQRG = gwinc.load_budget(fpath_join(iname), freq = F_Hz, bname = 'QuantumRelGamma')
budget = gwinc.load_budget(fpath_join(iname), freq = F_Hz)
......@@ -61,20 +92,31 @@ def test_Aplus_LO(pprint, tpath_join, fpath_join):
range_BH = range_data(RANGE_PARAMS_BH)
traces.plot(ax = ax_h)
tracesQRG.plot(ax = ax_QRG)
ax_h.set_title(kw1['label'] + ': ' + range_NS[1])
ax_QRG.set_title(range_BH[1])
fig_single = pyl.figure(linewidth = 4)
fig_single.set_size_inches(12, 4)
ax_h = fig_single.add_subplot(1, 2, 1)
ax_QRG = fig_single.add_subplot(1, 2, 2)
traces.plot(ax = ax_h)
tracesQRG.plot(ax = ax_QRG)
label = kw2.pop('label') + ' {:.0f}Mpc NS1.4, {:.2f}Gpc BH70'.format(range_NS[0], range_BH[0]/1e3)
kw2['label'] = label
ax_all.loglog(traces.freq, traces.asd, **kw2)
ax_allrel.loglog(traces.freq, traces.asd / traces_nom.asd, **kw2)
ax_allrelQ.loglog(traces.freq, traces['Quantum'].asd / traces_nom['Quantum'].asd, **kw2)
ax_h.set_title(kw1['label'] + ', GWINC Curves')
ax_QRG.set_title('Quantum noise sub-budget')
fig_single.tight_layout()
fig_single.savefig(tpath_join(iname + '.pdf'), edgecolor = kw1['color'])
label = kw1.pop('label').format(range_NS[0], range_BH[0]/1e3)
kw1['label'] = label
ax_all.loglog(traces.freq, traces['Quantum'].asd, **kw1)
ax_allrel.loglog(traces.freq, traces.asd / traces_nom.asd, **kw1)
ax_allrelQ.loglog(traces.freq, traces['Quantum'].asd / traces_nom['Quantum'].asd, **kw1)
axC.scatter(budget.ifo.Squeezer.FilterCavity.fdetune, budget.ifo.Squeezer.SQZAngle, color = kw1['color'])
ifos = [
("Aplusn1rad.yaml", dict(label = 'LO -0.1rad'), dict(label = 'LO -0.1rad')),
("Aplusn2rad.yaml", dict(label = 'LO -0.2rad'), dict(label = 'LO -0.2rad')),
("Aplusn3rad.yaml", dict(label = 'LO -0.3rad'), dict(label = 'LO -0.3rad')),
("Aplusn4rad.yaml", dict(label = 'LO -0.4rad'), dict(label = 'LO -0.4rad')),
("Aplusn1rad.yaml", dict(color = 'red', label = 'LO -0.1rad')),
("Aplusn2rad.yaml", dict(color = 'blue', label = 'LO -0.2rad')),
("Aplusn3rad.yaml", dict(color = 'green', label = 'LO -0.3rad')),
("Aplusn4rad.yaml", dict(color = 'indigo', label = 'LO -0.4rad')),
]
fig = pyl.figure()
fig.set_size_inches(12, 4 * len(ifos))
......@@ -82,16 +124,16 @@ def test_Aplus_LO(pprint, tpath_join, fpath_join):
fig.tight_layout()
fig.savefig(tpath_join('budgetQRG_neg.pdf'))
ifos = [
("Aplusp1rad.yaml", dict(label = 'LO +0.1rad'), dict(label = 'LO +0.1rad')),
("Aplusp2rad.yaml", dict(label = 'LO +0.2rad'), dict(label = 'LO +0.2rad')),
("Aplusp3rad.yaml", dict(label = 'LO +0.3rad'), dict(label = 'LO +0.3rad')),
]
fig = pyl.figure()
fig.set_size_inches(12, 4 * len(ifos))
plot_ifos(ifos)
fig.tight_layout()
fig.savefig(tpath_join('budgetQRG_pos.pdf'))
#ifos = [
# ("Aplusp1rad.yaml", dict(label = 'LO +0.1rad'), dict(label = 'LO +0.1rad')),
# ("Aplusp2rad.yaml", dict(label = 'LO +0.2rad'), dict(label = 'LO +0.2rad')),
# ("Aplusp3rad.yaml", dict(label = 'LO +0.3rad'), dict(label = 'LO +0.3rad')),
#]
#fig = pyl.figure()
#fig.set_size_inches(12, 4 * len(ifos))
#plot_ifos(ifos)
#fig.tight_layout()
#fig.savefig(tpath_join('budgetQRG_pos.pdf'))
ax_all.set_xlim(10, 3e3)
ax_all.set_ylim(1e-24, 3e-23)
......@@ -107,12 +149,48 @@ def test_Aplus_LO(pprint, tpath_join, fpath_join):
ax_all.set_ylabel('Strain ASD h/rtHz')
ax_allrel.set_ylabel('Total ASD relative to 0rad LO')
ax_allrelQ.set_ylabel('Quantum ASD relative to 0rad LO')
ax_all.set_title('GWINC Strain ASD at varying LO angles')
ax_all.set_title('GWINC Quantum ASD at varying LO angles')
ax_allrel.set_title('Relative GWINC Strain ASD')
ax_allrelQ.set_title('Relative Quantum Strain ASD')
fig_all.tight_layout()
fig_all.savefig(tpath_join('compare.pdf'))
figC.tight_layout()
figC.savefig(tpath_join('rangeNS.pdf'))
with h5py.File(fpath_join('contour.h5'), 'r') as hdf5:
figC = pyl.figure()
axC = figC.add_subplot(1, 1, 1)
extent = (
hdf5['fd'][0],
hdf5['fd'][-1],
hdf5['SQZ'][-1],
hdf5['SQZ'][0],
)
rel = hdf5['rangeBH'] / np.max(hdf5['rangeBH'])
pm = axC.imshow(
rel,
cmap = 'copper',
extent = extent,
)
CS = axC.contour(
hdf5['fd'], hdf5['SQZ'], rel,
levels = [.80, .9, .95, .99],
colors = ['black', 'blue', 'purple', 'red'],
#colors = [],
alpha = .7,
linewidths = 1,
)
axC.clabel(CS, inline=1, fontsize=8)
axC.set_aspect('auto')
axC.set_ylabel('Homodyne and SQZ angles [rad]')
axC.set_xlabel('Filter Cavity Detuning [Hz] \n using 1000ppm T_in')
figC.colorbar(pm, label = 'BBH 70/70Msol comoving inspiral range (relative max)')
figC.tight_layout()
figC.savefig(tpath_join('rangeBH.pdf'))
return
def test_Aplus_scan(pprint, tpath_join, fpath_join):
F_Hz = np.logspace(1, 3, 500)
......@@ -161,69 +239,3 @@ def test_Aplus_scan(pprint, tpath_join, fpath_join):
hdf5['SQZ'] = SQZang
return
def test_Aplus_plot(pprint, tpath_join, fpath_join):
import h5py
with h5py.File(fpath_join('contour.h5'), 'r') as hdf5:
fig = pyl.figure()
ax = fig.add_subplot(1, 1, 1)
extent = (
hdf5['fd'][0],
hdf5['fd'][-1],
hdf5['SQZ'][-1],
hdf5['SQZ'][0],
)
rel = hdf5['rangeNS'] / np.max(hdf5['rangeNS'])
pm = ax.imshow(
rel,
cmap = 'copper',
extent = extent,
)
CS = ax.contour(
hdf5['fd'], hdf5['SQZ'], rel,
levels = [.80, .9, .95, .99],
colors = ['black', 'blue', 'purple', 'red'],
#colors = [],
alpha = .7,
linewidths = 1,
)
ax.clabel(CS, inline=1, fontsize=8)
ax.set_aspect('auto')
ax.set_ylabel('Homodyne and SQZ angles [rad]')
ax.set_xlabel('Filter Cavity Detuning [Hz] \n using 1000ppm T_in')
fig.colorbar(pm, label = 'BNS 1.4/1.4Msol comoving inspiral range (relative max)')
fig.tight_layout()
fig.savefig(tpath_join('rangeNS.pdf'))
fig = pyl.figure()
ax = fig.add_subplot(1, 1, 1)
extent = (
hdf5['fd'][0],
hdf5['fd'][-1],
hdf5['SQZ'][-1],
hdf5['SQZ'][0],
)
rel = hdf5['rangeBH'] / np.max(hdf5['rangeBH'])
pm = ax.imshow(
rel,
cmap = 'copper',
extent = extent,
)
CS = ax.contour(
hdf5['fd'], hdf5['SQZ'], rel,
levels = [.80, .9, .95, .99],
colors = ['black', 'blue', 'purple', 'red'],
#colors = [],
alpha = .7,
linewidths = 1,
)
ax.clabel(CS, inline=1, fontsize=8)
ax.set_aspect('auto')
ax.set_ylabel('Homodyne and SQZ angles [rad]')
ax.set_xlabel('Filter Cavity Detuning [Hz] \n using 1000ppm T_in')
fig.colorbar(pm, label = 'BBH 70/70Msol comoving inspiral range (relative max)')
fig.tight_layout()
fig.savefig(tpath_join('rangeBH.pdf'))
return
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