Skip to content
Snippets Groups Projects
Commit 2904a2b4 authored by Chad Hanna's avatar Chad Hanna
Browse files

gstlal_inspiral_coinc_extractor: make gracedb uploads work again

parent c2c4ed2f
No related branches found
No related tags found
No related merge requests found
Pipeline #29980 passed
......@@ -125,12 +125,18 @@ for (cid, time, ifos) in cids:
coinceventmap.append(row)
# sngl inspiral table
sngl = lsctables.New(lsctables.SnglInspiralTable, columns = ("process_id", "ifo", "end_time", "end_time_ns", "eff_distance", "coa_phase", "mass1", "mass2", "snr", "chisq", "chisq_dof", "bank_chisq", "bank_chisq_dof", "sigmasq", "spin1x", "spin1y", "spin1z", "spin2x", "spin2y", "spin2z", "event_id"))
sngl = lsctables.New(lsctables.SnglInspiralTable)
xmldoc.appendChild(sngl)
rowfunc = snglrow(db)
#FIXME Terrible hack, figure out how to do this correctly
query = 'SELECT * FROM sngl_inspiral WHERE event_id IN (%s)' % ",".join(['"%s"' % str(i) for i in snglids])
for val in db.cursor().execute(query):
sngl.append(rowfunc(val))
thisrow = rowfunc(val)
fullrow = lsctables.New(lsctables.SnglInspiralTable)
for col in fullrow.validcolumns:
setattr(fullrow, col, None)
for attr in ("process_id", "ifo", "end_time", "end_time_ns", "eff_distance", "coa_phase", "mass1", "mass2", "snr", "chisq", "chisq_dof", "bank_chisq", "bank_chisq_dof", "sigmasq", "spin1x", "spin1y", "spin1z", "spin2x", "spin2y", "spin2z", "event_id"):
setattr(fullrow, attr, getattr(thisrow, attr))
sngl.append(fullrow)
utils.write_filename(xmldocmain, '%s-LLOID-%d-0.xml.gz' % (ifos.replace(",",""), time), gz=True, verbose=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment