Skip to content
Snippets Groups Projects

Draft: Ingestion of SVOM ECLAIRS notices into LLAI workflow

Open Naresh Adhikari requested to merge naresh.adhikari/gwcelery:addsvom into main
Compare and Show latest version
1 file
+ 7
6
Compare changes
  • Side-by-side
  • Inline
@@ -734,14 +734,14 @@ def _kafka_to_voevent(alert):
-------
payload : str
XML GCN notice alert packet in string format
payload, pipeline, time, trig_id
"""
# Define basic values
pipeline = alert['mission']
start_time = alert['trigger_time']
alert_time = alert['alert_datetime']
far = alert['far']
snr = alert['rate_snr']
far = alert.get('far')
snr = alert.get('rate_snr') # change this to make optional
duration = alert['rate_duration']
id = '_'.join(str(x) for x in alert['id'])
# Use central time since starting time is not well measured
@@ -771,0+771,0 @@
fname = f'{pipeline.lower()}_subgrbtargeted_template.xml'
ivorn_suffix = 'targeted_subthreshold'
else:
fname = 'svom_grb_template.xml'
fname = 'svom_grb_template.xml' #change the saved filename
ivorn_suffix = 'grb'
# Construct the full path to the template
@@ -792,7 +792,8 @@ def _kafka_to_voevent(alert):
if pipeline.lower() in ['fermi', 'swift']:
root.find("./What/Param[@name='TrigID']").attrib['value'] = str(id)
else:
root.find("./What/Param[@name='Burst_Id']").attrib['value'] = str(id)
root.find("./What/Group[@name='Svom_Identifiers']"
"/Param[@name='Burst_Id']").attrib['value'] = str(id)
# Change times to chosen time
root.find("./Who/Date").text = str(alert_time).encode()
@@ -812,7 +813,7 @@ def _kafka_to_voevent(alert):
root.find("./What/Param[@name='Integ_Time']").attrib['value'] = \
str(duration).encode()
else:
root.find("./Group[@name='Svom_Identifiers']"
root.find("./Group[@name='Svom_Identifiers']" # fix this
"/Param[@name='Timescale']").attrib['value'] = \
(str(duration).encode())
Loading