Skip to content
Snippets Groups Projects
Commit 88cbe5c1 authored by Chad Hanna's avatar Chad Hanna
Browse files

gstlal_inspiral_plot_extrinsic_params: add extrinsic paramaters code

parent e11778eb
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ dist_bin_SCRIPTS = \
gstlal_inspiral_pipe \
gstlal_inspiral_plot_background \
gstlal_inspiral_plot_banks \
gstlal_inspiral_plot_extrinsic_params \
gstlal_inspiral_plot_kernels \
gstlal_inspiral_plot_sensitivity \
gstlal_inspiral_plotsummary \
......
#!/usr/bin/python
import time
import numpy
import matplotlib
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['lines.markersize'] = 2
matplotlib.rcParams['lines.linewidth'] = 1
matplotlib.rcParams['font.size'] = 10
matplotlib.rcParams['savefig.dpi'] = 300
matplotlib.rcParams['text.latex.preamble'].append(r'\usepackage{amsmath}')
matplotlib.rcParams['legend.fontsize'] = 10
matplotlib.use("agg")
from matplotlib import pyplot
from gstlal.stats import inspiral_extrinsics
TPDPDF = inspiral_extrinsics.TPhiDeffPDF()
num = 100
dts = numpy.linspace(-0.010, 0.010, num)
dphis = numpy.linspace(-numpy.pi*.99, numpy.pi*.99, num)
jointpdf = numpy.zeros((num,num))
tpdf = numpy.zeros((num))
phipdf = numpy.zeros((num))
s = time.time()
for i, dt in enumerate(dts):
for j, dphi in enumerate(dphis):
t = {"H1": 0, "L1": dt}
phi = {"H1": 0, "L1": dphi}
deff = {"H1": 20., "L1": 20.}
prob = TPDPDF.IE(t, phi, deff)
tpdf[i] += prob
phipdf[j] += prob
jointpdf[i,j] = prob
print "evaluated %d probabilities in %f seconds" % (num**2, time.time()-s)
f = pyplot.figure(figsize=(10,10))
pyplot.subplot(222)
pyplot.plot(dts, tpdf)#, drawstyle="steps-mid")
pyplot.subplot(223)
pyplot.plot(phipdf, dphis)#, drawstyle="steps-mid")
pyplot.gca().invert_xaxis()
pyplot.subplot(224)
pyplot.pcolor(dts, dphis, jointpdf.T)
pyplot.xlabel("delta time")
pyplot.ylabel("delta phase")
pyplot.savefig("dtdphdeff.png")
This diff is collapsed.
dist_pkgdata_DATA = \
de_calc_likelihood.sql \
inj_simplify_and_cluster.sql \
inspiral_dtdphi_pdf.h5 \
inspiral_snr_pdf.xml.gz \
ll_simplify.sql \
ll_simplify_and_cluster.sql \
......
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