Commit 2c9ca49b authored by Brandon Piotrzkowski's avatar Brandon Piotrzkowski
Browse files

Add ivorn field

parent 379ecc62
Pipeline #89393 failed with stages
in 12 minutes and 3 seconds
......@@ -303,6 +303,17 @@ def construct_voevent_file(obj, voevent, request=None):
p_extid.Description = ("GCN trigger ID of external event")
emcoinc_params.append(p_extid)
## External IVORN
if voevent.ivorn:
p_extivorn = vp.Param(
"External_Ivorn",
value=ext_event.trigger_id,
ucd="meta.id",
dataType="string"
)
p_extivorn.Description = ("IVORN of external event")
emcoinc_params.append(p_extivorn)
## External Pipeline
if ext_event.pipeline:
p_extpipeline = vp.Param(
......
......@@ -589,6 +589,7 @@ class SupereventVOEventSerializer(serializers.ModelSerializer):
combined_skymap_filename = serializers.CharField(required=False)
delta_t = serializers.FloatField(write_only=True, min_value=-1000,
max_value=1000, required=False)
ivorn = serializers.CharField(required=False)
class Meta:
model = VOEvent
......@@ -602,7 +603,7 @@ class SupereventVOEventSerializer(serializers.ModelSerializer):
raven_fields = ('raven_coinc','ext_gcn', 'ext_pipeline', 'ext_search',
'time_coinc_far', 'space_coinc_far', 'combined_skymap_filename',
'delta_t')
'delta_t', 'ivorn')
# Combine the fields:
fields = fields + raven_fields
......@@ -611,7 +612,7 @@ class SupereventVOEventSerializer(serializers.ModelSerializer):
super(SupereventVOEventSerializer, self).__init__(*args, **kwargs)
read_only_fields = ['file_version', 'filename', 'ivorn',
'coinc_comment', 'prob_has_ns', 'prob_has_remnant', 'prob_bns',
'prob_nsbh', 'prob_bbh', 'prob_terrestrial', 'prob_mass_gap', ]
'prob_nsbh', 'prob_bbh', 'prob_terrestrial', 'prob_mass_gap']
for f in read_only_fields:
self.fields.get(f).read_only = True
......
......@@ -1025,6 +1025,9 @@ class VOEventBase(CleanSaveModel):
delta_t = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(-1000),
models.fields.validators.MaxValueValidator(1000)])
ivorn = models.CharField(max_length=300, default="", blank=True,
editable=False)
def fileurl(self):
# Override this method on derived classes
......
......@@ -63,4 +63,9 @@ class Migration(migrations.Migration):
name='time_coinc_far',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0)]),
),
migrations.AddField(
model_name='voevent',
name='ivorn',
field=models.CharField(blank=True, default='', editable=False, max_length=300),
)
]
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