Commit 700fd3e1 authored by Kipp Cannon's avatar Kipp Cannon

inspinjfind: fix for python-ligo-lw

- when using integer IDs, the ID objects no longer carry a .table_name
  attribute, so we must set the table names manually
parent 8195b3aa
......@@ -305,18 +305,18 @@ def add_sim_inspiral_coinc(contents, sim, inspirals):
coinc.insts = (event.ifo for event in inspirals)
coinc.nevents = len(inspirals)
coincmap = lsctables.CoincMap()
coincmap.coinc_event_id = coinc.coinc_event_id
coincmap.table_name = sim.simulation_id.table_name
coincmap.event_id = sim.simulation_id
contents.coincmaptable.append(coincmap)
contents.coincmaptable.append(lsctables.CoincMap(
coinc_event_id = coinc.coinc_event_id,
table_name = u"sim_inspiral",
event_id = sim.simulation_id
))
for event in inspirals:
coincmap = lsctables.CoincMap()
coincmap.coinc_event_id = coinc.coinc_event_id
coincmap.table_name = event.event_id.table_name
coincmap.event_id = event.event_id
contents.coincmaptable.append(coincmap)
contents.coincmaptable.append(lsctables.CoincMap(
coinc_event_id = coinc.coinc_event_id,
table_name = u"sngl_inspiral",
event_id = event.event_id
))
#
......@@ -367,18 +367,18 @@ def add_sim_coinc_coinc(contents, sim, coinc_event_ids, coinc_def_id):
coinc = contents.new_coinc(coinc_def_id)
coinc.nevents = len(coinc_event_ids)
coincmap = lsctables.CoincMap()
coincmap.coinc_event_id = coinc.coinc_event_id
coincmap.table_name = sim.simulation_id.table_name
coincmap.event_id = sim.simulation_id
contents.coincmaptable.append(coincmap)
contents.coincmaptable.append(lsctables.CoincMap(
coinc_event_id = coinc.coinc_event_id,
table_name = u"sim_inspiral",
event_id = sim.simulation_id
))
for coinc_event_id in coinc_event_ids:
coincmap = lsctables.CoincMap()
coincmap.coinc_event_id = coinc.coinc_event_id
coincmap.table_name = coinc_event_id.table_name
coincmap.event_id = coinc_event_id
contents.coincmaptable.append(coincmap)
contents.coincmaptable.append(lsctables.CoincMap(
coinc_event_id = coinc.coinc_event_id,
table_name = u"coinc_event",
event_id = coinc_event_id
))
#
......
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