From e256c2bcb2b4db65a721e8209980dfa60294d3a8 Mon Sep 17 00:00:00 2001 From: Branson Stephens <stephenb@uwm.edu> Date: Tue, 4 Feb 2014 09:00:14 -0600 Subject: [PATCH] Made changes to streamline CBC event presentation according to Issue 1176. --- gracedb/templatetags/timeutil.py | 16 ++ static/css/style.css | 3 + templates/gracedb/event_detail_LM.html | 218 +++++++++++++------------ 3 files changed, 131 insertions(+), 106 deletions(-) diff --git a/gracedb/templatetags/timeutil.py b/gracedb/templatetags/timeutil.py index 0290c58cf..7f7fd3389 100644 --- a/gracedb/templatetags/timeutil.py +++ b/gracedb/templatetags/timeutil.py @@ -12,6 +12,7 @@ from utils import posixToGpsTime, gpsToUtc import pytz import time import datetime +import logging # DATETIME_SETTINGS is guaranteed to be set. GRACE_DATETIME_FORMAT is not. FORMAT = getattr(settings, 'GRACE_DATETIME_FORMAT', settings.DATETIME_FORMAT) @@ -157,3 +158,18 @@ def timeSelections(t): rv['utc'] = dateformat.format(dt.astimezone(pytz.utc), format) return rv + +# XXX Branson added this. God will punish me. +@register.filter +def end_time(event,digits=4): + try: + #return float(event.end_time) + float(event.end_time_ns)/1.e9 + # The approach above did not work. For some reason, the value loses precision + # in the django template, so that the final digits get truncated and padded + # with zeros. Why? The current gpstime is only 10 digits. So I'm going to have to + # make this into a string. Totally sick, I know. + decimal_part = float(event.end_time_ns)/1.e9 + decimal_part = round(decimal_part,digits) + return str(event.end_time) + str(decimal_part)[1:] + except Exception, e: + return None diff --git a/static/css/style.css b/static/css/style.css index 6b0edf107..d95fe1c6f 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -12,6 +12,9 @@ table.event {border-bottom:1px solid gray;} /* Branson added */ table.event {width:100%} +table.analysis_specific_lm th {padding:3px;border:none;text-align:center;vertical-align:bottom;} +table.analysis_specific_lm {border-bottom:1px solid gray;} + table.analysis_specific {width:100%} table.gstlalcbc {border:0;border-spacing:0px;width:100%;} diff --git a/templates/gracedb/event_detail_LM.html b/templates/gracedb/event_detail_LM.html index a02d436d2..fb3c2d3ff 100644 --- a/templates/gracedb/event_detail_LM.html +++ b/templates/gracedb/event_detail_LM.html @@ -1,40 +1,42 @@ {% extends "gracedb/event_detail.html" %} - +{% load timeutil %} {% load scientific %} {# Analysis-specific attributes for an LM event#} {% block analysis_specific %} -<h3>Analysis-Specific Attributes</h3> -<table class="analysis_specific"> <tbody> - <tr> - <td> <table class="event"> <tbody> - <tr> <th> ifos </th> <td> {{object.ifos}} </td> </tr> - <tr> <th> end_time </th> <td> {{object.end_time}} </td> </tr> - <tr> <th> end_time_ns </th> <td> {{object.end_time_ns}} </td> </tr> - </tbody></table> - </td> - <td> <table class="event"> <tbody> - <tr> <th> mass </th> <td> {{object.mass|floatformat:"-4"}} </td> </tr> - <tr> <th> mchirp </th> <td> {{object.mchirp|floatformat:"-4"}} </td> </tr> - <tr> <th> minimum_duration </th> <td> {{object.minimum_duration|scientific}} </td> </tr> - </tbody></table> - </td> - <td> <table class="event"> <tbody> - <tr> <th> snr </th> <td> {{object.snr|floatformat:"-4"}} </td> </tr> - <tr> <th> false_alarm_rate </th> <td> {{object.false_alarm_rate|floatformat:"-4"}} </td> </tr> - <tr> <th> combined_far </th> <td> {{object.combined_far|scientific}} </td> </tr> - </tbody></table> - </td> +<div id="container" style="display:table;width:100%"> +<div style="display:table-row;width:100%"> - </tr> -</tbody> </table> +<div style="display:table-cell;float:left;width:35%;"> +<h3>Coinc Tables</h3> +<!-- <table class="analysis_specific"> <tbody> --> +<!-- 5 rows here --> +<table style="height:320px"> + <!-- <tr> <th> ifos </th> <td> {{object.ifos}} </td> </tr> --> + <tr> <th> End Time </th> <td> {{object|end_time:4}} </td> </tr> + <!--<tr> <th> end_time_ns </th> <td> {{object.end_time_ns}} </td> </tr> --> + <tr> <th> Total Mass </th> <td> {{object.mass|floatformat:"-4"}} </td> </tr> + <tr> <th> Chirp Mass </th> <td> {{object.mchirp|floatformat:"-4"}} </td> </tr> + <!--<tr> <th> minimum_duration </th> <td> {{object.minimum_duration|scientific}} </td> </tr>--> + <tr> <th> SNR </th> <td> {{object.snr|floatformat:"-4"}} </td> </tr> + <tr> <th> False Alarm Probability </th> <td> {{object.false_alarm_rate|scientific }} </td> </tr> + <!--<tr> <th> combined_far </th> <td> {{object.combined_far|scientific}} </td> </tr>--> +</table> +<!-- </tbody> </table> --> +</div> {% if single_inspiral_events %} <!-- Single Inspiral Data --> -<div id="single_inspiral_tables" +<!-- 13 rows here. --> +<div style="display:table-cell;float:right;width:65%"> +<h3>Single Inspiral Tables</h3> + +<!--<div id="single_inspiral_tables"> --> +<!-- <div id="single_inspiral_tables" data-dojo-type="dijit/TitlePane" - data-dojo-props="title: 'Single Inspiral Tables', open: false"> + data-dojo-props="title: 'Single Inspiral Tables', open: false"> --> + <!--<table class="analysis_specific_lm"> --> <table> <tr> <th>IFO</th> @@ -42,12 +44,12 @@ <th>{{ e.ifo }}</th> {% endfor %} </tr> - <tr> + <!-- <tr> <th>Search</th> {% for e in single_inspiral_events %} <td>{{ e.search }}</td> {% endfor %} - </tr> + </tr> --> <tr> <th>Channel</th> {% for e in single_inspiral_events %} @@ -60,30 +62,30 @@ <td>{{ e.end_time_full }}</td> {% endfor %} </tr> - <tr> + <!-- <tr> <th>Impulse Time</th> {% for e in single_inspiral_events %} <td>{{ e.impulse_time_full }}</td> {% endfor %} - </tr> + </tr> --> <tr> <th>Template Duration</th> {% for e in single_inspiral_events %} <td>{{ e.template_duration }}</td> {% endfor %} </tr> - <tr> + <!-- <tr> <th>Event Duration</th> {% for e in single_inspiral_events %} <td>{{ e.event_duration }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Amplitude</th> {% for e in single_inspiral_events %} <td>{{ e.amplitude }}</td> {% endfor %} - </tr> + </tr> --> <tr> <th>Effective Distance</th> {% for e in single_inspiral_events %} @@ -108,132 +110,132 @@ <td>{{ e.mass2 }}</td> {% endfor %} </tr> - <tr> + <!-- <tr> <th>MChirp</th> {% for e in single_inspiral_events %} <td>{{ e.mchirp }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>MTotal</th> {% for e in single_inspiral_events %} <td>{{ e.mtotal }}</td> {% endfor %} - </tr> + </tr> --> <tr> <th>η</th> {% for e in single_inspiral_events %} <td>{{ e.eta }}</td> {% endfor %} </tr> - <tr> + <!-- <tr> <th>κ</th> {% for e in single_inspiral_events %} <td>{{ e.kappa }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>χ</th> {% for e in single_inspiral_events %} <td>{{ e.chi }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>0</sub></th> {% for e in single_inspiral_events %} <td>{{ e.tau0 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>2</sub></th> {% for e in single_inspiral_events %} <td>{{ e.tau2 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>3</sub></th> {% for e in single_inspiral_events %} <td>{{ e.tau3 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>4</sub></th> {% for e in single_inspiral_events %} <td>{{ e.tau4 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>5</sub></th> {% for e in single_inspiral_events %} <td>{{ e.tau5 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>τ<sub>Total</sub></th> {% for e in single_inspiral_events %} <td>{{ e.ttotal }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Ψ<sub>0</sub></th> {% for e in single_inspiral_events %} <td>{{ e.psi0 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Ψ<sub>3</sub></th> {% for e in single_inspiral_events %} <td>{{ e.psi3 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α</th> {% for e in single_inspiral_events %} <td>{{ e.alpha }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>1</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha1 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>2</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha2 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>3</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha3 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>4</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha4 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>5</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha5 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>α<sub>6</sub></th> {% for e in single_inspiral_events %} <td>{{ e.alpha6 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>β</th> {% for e in single_inspiral_events %} <td>{{ e.beta }}</td> {% endfor %} - </tr> + </tr> --> <tr> <th>F Final</th> {% for e in single_inspiral_events %} @@ -258,104 +260,108 @@ <td>{{ e.chisq_dof }}</td> {% endfor %} </tr> - <tr> + <!-- <tr> <th>Bank χ<sup>2</sup></th> {% for e in single_inspiral_events %} <td>{{ e.bank_chisq }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Bank χ<sup>2</sup> DOF</th> {% for e in single_inspiral_events %} <td>{{ e.bank_chisq_dof }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Cont χ<sup>2</sup></th> {% for e in single_inspiral_events %} <td>{{ e.cont_chisq }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Cont χ<sup>2</sup> DOF</th> {% for e in single_inspiral_events %} <td>{{ e.cont_chisq_dof }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Σ<sup>2</sup></th> {% for e in single_inspiral_events %} <td>{{ e.sigmasq }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>RSQ Veto Duration</th> {% for e in single_inspiral_events %} <td>{{ e.rsqveto_duration }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>0</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma0 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>1</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma1 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>2</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma2 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>3</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma3 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>4</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma4 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>5</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma5 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>6</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma6 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>7</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma7 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>8</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma8 }}</td> {% endfor %} - </tr> - <tr> + </tr> --> + <!-- <tr> <th>Γ<sub>9</sub></th> {% for e in single_inspiral_events %} <td>{{ e.gamma9 }}</td> {% endfor %} - </tr> + </tr> --> </table> +</div> + </div> +</div> <!-- container --> + {% endif %} {% endblock %} -- GitLab