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
2 files
+ 9
88
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -734,7+734,7 @@
-------
payload : str
XML GCN notice alert packet in string format
"""
# Define basic values
pipeline = alert['mission']
start_time = alert['trigger_time']
alert_time = alert['alert_datetime']
far = alert['far']
snr = alert['rate_snr']
duration = alert['rate_duration']
id = '_'.join(str(x) for x in alert['id'])
# Use central time since starting time is not well measured
@@ -770,7 +771,7 @@ def _kafka_to_voevent(alert):
fname = f'{pipeline.lower()}_subgrbtargeted_template.xml'
ivorn_suffix = 'targeted_subthreshold'
else:
fname = 'svom_grb_template_xml'
fname = 'svom_grb_template.xml'
ivorn_suffix = 'grb'
# Construct the full path to the template
@@ -791,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("./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()
@@ -803,14 +805,16 @@ def _kafka_to_voevent(alert):
root.find("./What/Param[@name='FAR']").attrib['value'] = \
(str(far).encode())
else:
root.find("./What/Param[@name='SNR']").attrib['value'] = \
root.find("./Group[@name='Detection_Info']"
"/Param[@name='SNR']").attrib['value'] = \
(str(snr).encode())
if pipeline.lower() in ['fermi', 'swift']:
root.find("./What/Param[@name='Integ_Time']").attrib['value'] = \
str(duration).encode()
else:
root.find("./What/Param[@name='Timescale']").attrib['value'] = \
root.find("./Group[@name='Svom_Identifiers']"
"/Param[@name='Timescale']").attrib['value'] = \
(str(duration).encode())
# Sky position
Loading