From ce3e57cfdb9778969f15a1822e2553d16ee1b10e Mon Sep 17 00:00:00 2001
From: ChiWai Chan <chiwai.chan@ligo.org>
Date: Mon, 20 May 2019 23:25:14 -0700
Subject: [PATCH] gstlal_inspiral_lvalert_snrtimeseries_plotter: 
 --ensuring the template autocorrelation vs time is plotted with same length.

---
 .../bin/gstlal_inspiral_lvalert_snrtimeseries_plotter          | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gstlal-inspiral/bin/gstlal_inspiral_lvalert_snrtimeseries_plotter b/gstlal-inspiral/bin/gstlal_inspiral_lvalert_snrtimeseries_plotter
index ab2807c6e5..c0fc9a766c 100755
--- a/gstlal-inspiral/bin/gstlal_inspiral_lvalert_snrtimeseries_plotter
+++ b/gstlal-inspiral/bin/gstlal_inspiral_lvalert_snrtimeseries_plotter
@@ -166,8 +166,9 @@ for gid in gid_list:
 
 		ax = fig.add_subplot(len(timeseries_ligolw_dict.items()),1,i+1)
 		ax.fill_between(time[int(peakoffset-(autocorr_length-1)/2):int(peakoffset+(autocorr_length+1)/2+1)], snr[int(peakoffset-(autocorr_length-1)/2):int(peakoffset+(autocorr_length+1)/2+1)]-snrsigma, snr[int(peakoffset-(autocorr_length-1)/2):int(peakoffset+(autocorr_length+1)/2+1)]+snrsigma, color="0.75")
+		#FIXME : This could potentially create an asymmetric plot. Since the peakoffset may not be the "center" of snr timeseries but could be off by one index from the "center".
 		ax.plot(time[peakoffset-(autocorr_length-1)/2:peakoffset+(autocorr_length+1)/2], snr[int(peakoffset-(autocorr_length-1)/2):int(peakoffset+(autocorr_length+1)/2+1)], "k", label = r"$\mathrm{Measured}\,\rho(t)$")
-		ax.plot(time[peakoffset-(autocorr_length-1)/2:peakoffset+(autocorr_length+1)/2], auto.real*maxsnr, "b--", label = r"$\mathrm{Scaled\,Autocorrelation}$")
+		ax.plot(time[peakoffset-(autocorr_length-1)/2:peakoffset+(autocorr_length+1)/2], auto.real[peakoffset-(autocorr_length-1)/2:peakoffset+(autocorr_length+1)/2]*maxsnr, "b--", label = r"$\mathrm{Scaled\,Autocorrelation}$")
 		ax.set_ylabel(r"$\mathrm{%s}\,\rho(t)$" % ifo)
 		ax.set_xlabel(r"$\mathrm{Time\,from\,%f}$" % peaktime)
 		ax.legend(loc="best")
-- 
GitLab