Commit 54e9c062 authored by Jonah Kanner's avatar Jonah Kanner 🤓 Committed by GraceDB

far in hz

parent 05e210f8
......@@ -198,7 +198,7 @@ class SupereventPublic(ListView):
return context
class SupereventPublic2(ListView):
class SupereventPublic2(DisplayFarMixin, ListView):
model = Superevent
template_name = 'superevents/public.html'
filter_permissions = ['superevents.view_superevent']
......@@ -240,16 +240,15 @@ class SupereventPublic2(ListView):
se.default_superevent_id)
se.gcnurl = self.gcnurl_template.format(sd_id=
se.default_superevent_id[1:])
# Comment from Tanner: suggest to refactor ifar yrs so it shows as
# either 1 per X yrs or 1/X per 1 yr, depending on which one
# is most understandable (see lines 389-398 of events/views.py)
# However: is this right? Looks like we are presenting iFAR as FAR
# in the template. Maybe I'm not understanding it, though.
se.ifar_yrs = 1.0 / (se.far*3600*24*365.0)
se.t0_iso = gpstime.gps_to_utc(se.t_0).isoformat(' ').split('.')[0]
se.t0_utc = se.t0_iso.split()[1]
# Get display FARs for preferred_event
se.disp_far = self.get_display_far(obj=se.preferred_event)[0]
#-- Get list of voevents
# Comment from Tanner: do as much work as you can in the database.
# Also, use VOEvent types from the model rather than hard-coding
......
......@@ -44,22 +44,20 @@
{% endif %}
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4">Comments</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="0">GPS</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="0">False Alarm Rate (per year)</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="5">GPS</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-numeric data-tablesaw-priority="0">FAR (Hz)</th>
<th scope="col" data-tablesaw-col data-tablesaw-priority="0">VOEvent</th>
{% if not user_is_external %}
<th scope="col" data-tablesaw-col data-tablesaw-priority="0">PE</th>
{% endif %}
{% endif %}
</tr>
</thead>
<tbody>
{% for event in object_list %}
<tr {% if event.retract %}style='background-color:#EDD' {% endif %} >
<tr{% if event.retract %} style='background-color:#EDD' {% endif %}>
<td style='min-width:100px;'><a href=/superevents/{{ event.superevent_id }}>{{ event.default_superevent_id }}</a></td>
......@@ -86,7 +84,9 @@
<td>{{ event.comments |safe}} </td>
<td>{{ event.t_0|floatformat:2 }} </td>
<td> 1 per {{ event.ifar_yrs|floatformat:2 }} years</td>
<!-- <td> 1 per {{ event.ifar_yrs|floatformat:2 }} years</td> -->
<td> {{ event.disp_far|stringformat:".2e" }} </td>
<td> <a href='/api/superevents/{{ event.default_superevent_id }}/voevents/'>VOEvent</a></td>
{% if not user_is_external %} <td> {{ event.pe |safe}}</td> {% endif %}
......
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