Skip to content
Snippets Groups Projects
Commit 4665585a authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Added trigger_id field to GrbEvent, and created migration.

Added trigger_id to translator code and serialization.
Added trigger_id to GRB event display.
parent 0ad0fd66
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('gracedb', '0002_auto_20150708_1140'),
]
operations = [
migrations.AddField(
model_name='grbevent',
name='trigger_id',
field=models.CharField(max_length=25, null=True),
),
]
......@@ -790,6 +790,7 @@ class GrbEvent(Event):
t90 = models.FloatField(null=True)
designation = models.CharField(max_length=20, null=True)
redshift = models.FloatField(null=True)
trigger_id = models.CharField(max_length=25, null=True)
class CoincInspiralEvent(Event):
ifos = models.CharField(max_length=20, default="")
......
......@@ -645,3 +645,11 @@ def populateGrbEventFromVOEventFile(filename, event):
except:
pass
event.trigger_duration = trigger_duration
# try to find a trigger_id value
trigger_id = None
try:
trigger_id = findParam(v, '', 'TrigID').get_value()
except:
pass
event.trigger_id = trigger_id
......@@ -150,6 +150,9 @@ def eventToDict(event, columns=None, request=None):
"how_reference_url" : event.how_reference_url,
"T90" : event.t90,
"trigger_duration": event.trigger_duration,
"designation": event.designation,
"redshift": event.redshift,
"trigger_id": event.trigger_id,
}
except:
pass
......
......@@ -68,6 +68,9 @@
{{object.how_description}}
{% endif %}
</td></tr>
{% if object.trigger_id %}
<tr><th>Trigger ID</th><td colspan="2">{{object.trigger_id}}</td></tr>
{% endif %}
{% if object.trigger_duration %}
<tr><th>Trigger duration</th><td colspan="2">{{object.trigger_duration}}</td></tr>
{% endif %}
......
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