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
12 unresolved threads
Compare and Show latest version
2 files
+ 18
90
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -741,6 +741,7 @@ def _kafka_to_voevent(alert):
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
@@ -767,10 +768,10 @@ def _kafka_to_voevent(alert):
# Load template based on the mission
# FIXME: Need to adjust for targeted Fermi-Swift and SVOM/ECLAIRS GRBs
if pipeline.lower() in ['fermi', 'swift']:
fname = f'{pipeline_lower()}_subgrbtargeted_template.xml'
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
@@ -799,11 +800,21 @@ def _kafka_to_voevent(alert):
"ObservationLocation/AstroCoords/Time/TimeInstant/"
"ISOTime")).text = str(trigger_time).encode()
root.find("./What/Param[@name='FAR']").attrib['value'] = \
str(far).encode()
if pipeline.lower() in ['fermi', 'swift']:
root.find("./What/Param[@name='FAR']").attrib['value'] = \
(str(far).encode())
else:
root.find("./Group[@name='Detection_Info']"
"/Param[@name='SNR']").attrib['value'] = \
(str(snr).encode())
root.find("./What/Param[@name='Integ_Time']").attrib['value'] = \
str(duration).encode()
if pipeline.lower() in ['fermi', 'swift']:
root.find("./What/Param[@name='Integ_Time']").attrib['value'] = \
str(duration).encode()
else:
root.find("./Group[@name='Svom_Identifiers']"
"/Param[@name='Timescale']").attrib['value'] = \
(str(duration).encode())
# Sky position
root.find(("./WhereWhen/ObsDataLocation/"
Loading