Commit 73494bc4 authored by Alexander Pace's avatar Alexander Pace
Browse files

Add new labels.

Adding NOT_GRB and EXT_SKYMAP_READY labels in support of

emfollow/gwcelery!725
parent 2a3a6afd
......@@ -39,6 +39,8 @@ Here is a table showing the currently available labels and their meanings.
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| EM_Throttled | GraceID is ignored by automatic processing because the corresponding pipeline submitted too many events too quickly. |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| EXT_SKYMAP_READY| External skymap is available |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| GCN_PRELIM_SENT | A preliminary GCN has been sent. |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| GRB_OFFLINE | Indicates that offline triggered GRB searches found something coincident with this event. |
......@@ -65,10 +67,12 @@ Here is a table showing the currently available labels and their meanings.
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| L1OPS | L1 operator signoff requested. |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| LUMIN_GO | LUMIN Go |
| LUMIN_GO | Trigger satisfies basic automated checks and should be vetted by humans. Replaced by ADVREQ |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| LUMIN_NO | LUMIN No |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| NOT_GRB | Event is likely not an astrophysical gamma ray burst |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| PASTRO_READY | p_astro is available. |
+-----------------+----------------------------------------------------------------------------------------------------------------------------------------+
| PE_READY | Parameter estimation results are available |
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-06-28 10:40:45
from __future__ import unicode_literals
from django.db import migrations
# Create initial Label instances
# List of label names, default colors, and descriptions
LABELS = [
{
'name': 'NOT_GRB',
'defaultColor': 'black',
'description': 'Event is likely not an astrophysical gamma ray burst',
},
{
'name': 'EXT_SKYMAP_READY',
'defaultColor': 'green',
'description': 'A RAVEN coincidence event is publishable',
},
]
def add_labels(apps, schema_editor):
Label = apps.get_model('events', 'Label')
# Create labels
for label_dict in LABELS:
l, created = Label.objects.get_or_create(name=label_dict['name'])
l.defaultColor = label_dict['defaultColor']
l.description = label_dict['description']
l.save()
def remove_labels(apps, schema_editor):
Label = apps.get_model('events', 'Label')
# Delete labels
for label_dict in LABELS:
try:
l = Label.objects.get(name=label_dict['name'])
except Label.DoesNotExist:
print('Label {0} not found to be deleted, skipping.' \
.format(label_dict['name']))
break
l.delete()
class Migration(migrations.Migration):
dependencies = [
('events', '0043_add_raven_label'),
]
operations = [
migrations.RunPython(add_labels, remove_labels),
]
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