Skip to content
Snippets Groups Projects
Commit 270766d3 authored by James Clark's avatar James Clark
Browse files

Merge branch 'residuals_histogram_fix' into 'master'

Fix residual histogram plotting code

See merge request lscsoft/bayeswave!19
parents 019860af f4685d17
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ import pwd
import subprocess
import sys
import re
import traceback
print 'Path to megaplot: '
print sys.argv[0]
......@@ -156,7 +157,10 @@ def readbwb():
bayeswave = open(bayeswaverunfile, 'r')
# -- Parse command line arguments
lines = bayeswave.readlines()
cmdline = lines[8].rstrip().split(' ')
if(len(lines[8].strip())!=0):
cmdline = lines[8].rstrip().split(' ')
else:
cmdline = lines[7].rstrip().split(' ')
for index, arg in enumerate(cmdline):
# Determine the IFOs involved
......@@ -1392,7 +1396,7 @@ def whitened_residual_plots(model,ifoList,ifoNames):
elif model == 'noise':
colour = ncolor
hashlist = ['solid','dashed']
hashlist = ['solid','dashed','dashdot']
plt.clf()
......@@ -1409,7 +1413,7 @@ def whitened_residual_plots(model,ifoList,ifoNames):
for ifo in ifoList:
filename = 'post/{1}_median_PSD.dat.{0}'.format(ifo,mod)
filename = 'post/{1}_median_PSD.dat.{0}'.format(ifo,model)
psd_info[ifo] = get_waveform(filename)
imin = 0
......@@ -1427,7 +1431,6 @@ def whitened_residual_plots(model,ifoList,ifoNames):
#### --- Histograms
plt.plot(x,mlab.normpdf(x, mu, sigma),color='k',lw=1.4,label='$\mathcal{N}[0,1]$')
for ifo in ifoList:
plt.hist(whitened[ifo][imin::],bins=50,normed=True,color=colour,label=ifoNames[int(ifo)],histtype='step',ls=hashlist[int(ifo)])
plt.title(model)
......@@ -2337,13 +2340,14 @@ if 'signal' in modelList or 'glitch' in modelList:
for mod in modelList:
try:
whitened_residual_plots(mod,ifoList,ifoNames)
except:
print "fourier residual files not found"
except Exception as e:
print "Error producing %s residual histograms"%mod
print traceback.format_exc()
try:
whitened_residual_plots('noise',ifoList,ifoNames)
except:
print "noise fourier residual files not found"
except Exception as e:
print "Error producing noise residual histograms"
print traceback.format_exc()
# -- Create directory that will contain all webpage code
......
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