Commit 046fe82e authored by John Douglas Veitch's avatar John Douglas Veitch

some cleanups for spin disk script

parent f400d298
......@@ -11,7 +11,7 @@ rc('font', family='lmodern')
small, big = 10, 12
rc('axes', labelsize=big)
rc('text', fontsize=big)
rc('font',size=big)
rc('legend', fontsize=small)
rc('xtick', labelsize=small)
rc('ytick', labelsize=small)
......
......@@ -628,12 +628,7 @@ def cbcBayesPostProc(
wfsection.write('<a href="calibration.png" target="_blank"><img src="calibration.png"/></a>')
# if precessing spins do spin disk
allin=1.0
for i in ['a1','tilt_spin1','a2','tilt_spin2']:
if not i in pos.names:
allin*=0.0
if allin ==0.0:
pass
else:
if set(['a1','a2','tilt1','tilt2']).issubset(pos.names):
wftd=html_wf.insert_td(row,'',label='DiskPlot',legend=legend)
wfsection=html.add_section_to_element('DiskPlot',wftd)
lalinference.plot.make_disk_plot(pos, outpath=outdir)
......
......@@ -478,6 +478,11 @@ def plot_label(param):
'dsigma2':r'$d\sigma_2$',
'dsigma3':r'$d\sigma_3$',
'dsigma4':r'$d\sigma_4$',
'optimal_snr':r'$\rho^{opt}$',
'h1_optimal_snr':r'$\rho^{opt}_{H1}$',
'l1_optimal_snr':r'$\rho^{opt}_{L1}$',
'v1_optimal_snr':r'$\rho^{opt}_{V1}$',
'matched_filter_snr':r'$\rho^{MF}$'
}
# Handle cases where multiple names have been used
......@@ -3942,7 +3947,7 @@ def plot_one_param_pdf(posterior,plot1DParams,analyticPDF=None,analyticCDF=None,
@param plotkde: Use KDE to smooth plot (default: False)
"""
# matplotlib.rcParams['text.usetex']=True
matplotlib.rcParams['text.usetex']=False
param=plot1DParams.keys()[0].lower()
histbins=plot1DParams.values()[0]
......
......@@ -9,12 +9,12 @@ __all__=('make_disk_plot',)
def make_disk_plot(post,outpath=None):
from matplotlib import pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
rc('text', usetex=False)
rc('font', family='lmodern')
small, big = 10, 12
rc('axes', labelsize=big)
rc('text', fontsize=big)
rc('font', size=big)
rc('legend', fontsize=small)
rc('xtick', labelsize=small)
rc('ytick', labelsize=small)
......@@ -28,16 +28,13 @@ def make_disk_plot(post,outpath=None):
return None
a1='a1'
tilt1='tilt_spin1'
tilt1='tilt1'
a2='a2'
tilt2='tilt_spin2'
tilt2='tilt2'
names=post.names
allin=1.0
for i in [a1,tilt1,a2,tilt2]:
if not i in names:
allin*=0.0
if allin==0.0:
if not set([a1,a2,tilt1,tilt2]).issubset(names):
print("Cannot plot spin disk plot. Not all required spin parameters exist in the posterior file. Skipping...\n")
return None
......
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