Commit c4a898d6 authored by Meg Millhouse's avatar Meg Millhouse
Browse files

add SNR to webpages

git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@492 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent 6c791b7f
......@@ -47,8 +47,9 @@ moments_dict['overlap_plus'] = ['Plus Polarization Overlap - recovered signal an
moments_dict['network_overlap_plus'] = ['Plus Polarization Network overlap - recovered signal and injection', 'network_overlap_plus']
moments_dict['overlap_cross'] = ['Cross Polarization Overlap - recovered signal and injection', 'overlap_cross']
moments_dict['network_overlap_cross'] = ['Cross Polarization Network overlap - recovered signal and injection', 'network_overlap_cross']
moments_dict['h_max'] = ['|h(t)| waximum value', 'hmax']
moments_dict['h_max'] = ['|h(t)| maximum value', 'hmax']
moments_dict['t_at_h_max'] = ['Time which |h(t)| is maximum (s)', 't_at_hmax']
moments_dict['snr'] = ['Recovered SNR','snr']
# 1st entry = html file name
# 2nd entry = subpage header
......@@ -76,6 +77,7 @@ html_dict['glitch_spec'] = ['', 'Spectrogram of median reconstructed glitch mode
html_dict['diagnostics'] = ['diagnostics', 'Diagnostic plots']
html_dict['skymap'] = ['skymap', 'Skymap']
html_dict['inj_spec'] = ['injections', 'Injection spectrograms', 'inj_self_spec']
html_dict['snr'] = ['snr','SNR','snr']
modelList = ('signal', 'glitch')
upperCaseModel_dict = {'glitch': 'Glitch', 'signal': 'Signal', 'noise': 'Noise', 'clean': 'Clean'}
......@@ -718,6 +720,10 @@ def mode_values(moment, ifo, mdc, momentsPlus, momentsCross, ifoList, tablesDir,
mode, low, high = table_data[18]
if mdc:
inmode = table_data[19][0]
elif moment == 'snr':
mode, low, high = table_data[20]
print mode, low, high
# -- Return recovered mode value, 90% credible interval limites, and injected mode
return(mode, low, high, inmode)
......@@ -893,7 +899,7 @@ def plot_model_dims(modelList, ifoList, ifoNames, plotsDir):
#
######################################################################################################################
def make_mode_table(page, subpage, imdc, momentsPlus, momentsCross, ifoList, tablesDir, ifoNames, worc):
if page in ['dur_rec', 't_energy_rec', 'f0_rec', 'band_rec', 't0_rec', 'h_max', 't_at_h_max']: # All histogram pages, excluding overlaps
if page in ['dur_rec', 't_energy_rec', 'f0_rec', 'band_rec', 't0_rec', 'h_max', 't_at_h_max', 'snr']: # All histogram pages, excluding overlaps
# -- Table header
subpage.write(' <br/>\n')
subpage.write(' <table id="tab1">\n')
......@@ -1029,7 +1035,7 @@ def make_subpage(htmlDir, plotsDir, page, model, modelList, ifoList, ifoNames, m
plotsrc = './'+plotsDir+html_dict[page][2]+'_{0}_full.png'.format(ifo)
subpage.write(' <a href="'+plotsrc+'"><img src="'+plotsrc+'" alt="'+plotsrc+'" width=500></a>\n')
subpage.write("</div>\n")
elif page in ['dur_rec', 't_energy_rec', 'f0_rec', 'band_rec', 't0_rec', 'h_max', 't_at_h_max']: # All histogram pages, excluding overlaps
elif page in ['dur_rec', 't_energy_rec', 'f0_rec', 'band_rec', 't0_rec', 'h_max', 't_at_h_max','snr']: # All histogram pages, excluding overlaps
subpage.write(' <br/>\n')
for ytype in ['lin', 'log10']:
if ytype == 'log10':
......@@ -1208,6 +1214,7 @@ def make_index(htmlDir, plotsDir, tablesDir, model, gps, ifoList, ifoNames, snrL
index.write(' <li class="menuitem" id="waveform">Time domain waveforms\n')
index.write(' <li class="menuitem" id="spec">Spectrogram\n')
index.write(' <li class="menuitem" id="bayesogram">Bayesogram (time)\n')
index.write(' <li class="menuitem" id="snr">SNR\n')
index.write(' <li class="menuitem" id="energy">Signal energy\n')
index.write(' <li class="menuitem" id="t0">Central time\n')
index.write(' <li class="menuitem" id="duration">Duration\n')
......@@ -1279,6 +1286,7 @@ def make_webpage(htmlDir, model, mdc, gps, ifoList, ifoNames, modelList, snrList
make_subpage(htmlDir, plotsDir, 'spec', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
make_subpage(htmlDir, plotsDir, 'diagnostics', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
make_subpage(htmlDir, plotsDir, 'skymap', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
make_subpage(htmlDir, plotsDir, 'snr', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
if mdc:
make_subpage(htmlDir, plotsDir, 'overlap', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
make_subpage(htmlDir, plotsDir, 'inj_spec', model, modelList, ifoList, ifoNames, momentsPlus, momentsCross)
......@@ -1404,6 +1412,7 @@ for mod in modelList:
outfile.write("# 18 Injected Max ||h(t)|| (repeated three times, 0's if this info is not available)\n")
outfile.write("# 19 t at Max ||h(t)|| (mode, 90% lower bound, 90% upper bound)\n")
outfile.write("# 20 Injected t at Max ||h(t)|| (repeated three times, 0's if this info is not available)\n")
outfile.write("# 21 SNR (mode, 90% lower bound, 90% upper bound)\n")
# -- Histogram of the overlaps: use both linear and log10 y-axis
if mdc:
......@@ -1456,6 +1465,8 @@ for mod in modelList:
make_histogram(moments, 'h_max', ifo, plotsDir, worc, outfile, 'lin', ytype)
# Histogram of t at maximum ||h(t)||
make_histogram(moments, 't_at_h_max', ifo, plotsDir, worc, outfile, 'lin', ytype)
# Histogram of snr
make_histogram(moments,'snr', ifo, plotsDir, worc, outfile, 'lin', ytype)
# -- End the loop over white/colored moments
outfile.close()
......
......@@ -73,6 +73,11 @@ $(document).ready(function(){
$("#main").load("./html/injections.html");
});
});
$(document).ready(function(){
$("#snr").click(function(){
$("#main").load("./html/snr.html");
});
});
function toggle(showHideDiv, switchTextDiv) {
var ele = document.getElementById(showHideDiv);
var text = document.getElementById(switchTextDiv);
......
......@@ -67,4 +67,4 @@ except:
os.chdir('..')
print cmd
call('BayesWavePost ' + cmd, shell=True)
call('/home/meg.millhouse/bayeswave/trunk/src/BayesWavePost ' + cmd, shell=True)
......@@ -116,7 +116,8 @@ def make_skyview(directory='.', mdc=None, NSIDE=256, ra=None, dec=None, results=
count = 0
while redo:
try:
kde = sky.ClusteredKDEPosterior(radec)
#kde = sky.ClusteredKDEPosterior(radec)
kde = sky.ClusteredSkyKDEPosterior(radec)
redo = False
except:
count += 1
......
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