Skip to content
Snippets Groups Projects
Commit c004f38f authored by Lee McCuller's avatar Lee McCuller
Browse files

add ifo to plot_noises to fix displacement plotting

parent c9d563e2
No related branches found
No related tags found
2 merge requests!7Plotting,!3Master
Pipeline #
......@@ -148,13 +148,14 @@ You may interact with plot using "plt." methods, e.g.:
>>> plt.savefig("foo.pdf")
''')
ipshell.enable_pylab()
ipshell.run_code("plot_noise(noises)")
ipshell.run_code("plot_noise(ifo, noises)")
ipshell.run_code("plt.title('{}')".format(title))
ipshell()
elif args.plot:
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
plot_noise(
ifo,
noises,
ax = ax,
displacement = args.displacement,
......
......@@ -98,7 +98,7 @@ def noise_calc(ifo, f):
noises['Seismic'] *= Ndispl**2
noises['Coating Thermo-Optic'] *= N_TO
#noises['Mirror Thermal'] = noises['Substrate Brownian'] + noises['Coating Brownian'] + \
# noises['Substrate Thermo-Elastic'] + noises['Coating Thermo-Optic'] # total mirror thermal
# noises['Substrate Thermo-Elastic'] + noises['Coating Thermo-Optic'] # total mirror thermal
noises['Total'] = sum(noises[curve] for curve in noises)
noises['Freq'] = f
......@@ -150,7 +150,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True):
# Report input parameters
if ifo.Optics.Type == 'DualCarrier_new': #include the case for Dual carrier
finesseA = 2*pi/ifo.Optics.ITM.TransmittanceD1
finesseB = 2*pi/ifo.Optics.ITM.TransmittanceD2
finesseB = 2*pi/ifo.Optics.ITM.TransmittanceD2
pbsA = ifo.Laser.PBSD1
pbsB = ifo.Laser.PBSD2
logging.info('Finesse for carrier A: %7.2f' % finesseA)
......@@ -185,7 +185,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True):
np.hstack([(finesse*2/pi) * ifo.Optics.ITM.CoatingAbsorption,
(2 * ifo.Materials.MassThickness) * ifo.Optics.ITM.SubstrateAbsorption])
# Stefan's Mysterious TCS Section ~~~~ `~~ ` ` 324@#%@#$ !
# Stefan's Mysterious TCS Section ~~~~ `~~ ` ` 324@#%@#$ !
M = np.array([[ifo.TCS.s_cc, ifo.TCS.s_cs], [ifo.TCS.s_cs, ifo.TCS.s_ss]])
S_uncorr = PowAbsITM.T*M*PowAbsITM
TCSeff = 1-sqrt(ifo.TCS.SRCloss/S_uncorr)
......@@ -201,6 +201,6 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True):
logging.info('BBH Inspiral Range: ' + str(score.effr0bh) + ' Mpc/ z = ' + str(score.zHorizonBH))
logging.info('Stochastic Omega: %4.1g Universes' % score.Omega)
plot.plot_noise(noises)
plot.plot_noise(ifo, noises)
return score, noises, ifo
......@@ -61,6 +61,7 @@ STYLE_MAP = {
def plot_noise(
ifo,
noises,
ax = None,
displacement = True,
......@@ -80,7 +81,7 @@ def plot_noise(
Update second axis according with first axis.
"""
y1, y2 = ax.get_ylim()
ax_d.set_ylim(y1 * 4000, y2 * 4000)
ax_d.set_ylim(y1 * ifo.Infrastructure.Length, y2 * ifo.Infrastructure.Length)
ax_d.figure.canvas.draw()
ax.callbacks.connect("ylim_changed", convert_ax_h_to_d)
ax_d.set_ylabel(u"Displacement [m/\u221AHz]")
......
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