Skip to content

Commit

Permalink
Fix a couple of output/upload value issues in pycbc live (#4953)
Browse files Browse the repository at this point in the history
* get singles back to being reduced chisquared in uploads

* Save ranking statistic information in the "likelihood" part of the coinc table

* Not all CandidateForGraceDB will have stat in the coinc_results
  • Loading branch information
GarethCabournDavies authored Nov 25, 2024
1 parent b7cb8bc commit fd06cfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pycbc/events/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def check(self, trigs, data_reader):

# fill in a new candidate event
candidate = {
f'foreground/{self.ifo}/{k}': cutall_trigs[k][i] for k in trigs
f'foreground/{self.ifo}/{k}': cut_trigs[k][sngl_idx][i]
for k in trigs
}
candidate['foreground/stat'] = rank[i]
candidate['foreground/ifar'] = ifar
Expand Down
5 changes: 4 additions & 1 deletion pycbc/io/gracedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def __init__(self, coinc_ifos, ifos, coinc_results, **kwargs):
coinc_event_row.time_slide_id = lsctables.TimeSlideID(0)
coinc_event_row.process_id = proc_id
coinc_event_row.coinc_event_id = coinc_id
coinc_event_row.likelihood = 0.
if 'foreground/stat' in coinc_results:
coinc_event_row.likelihood = coinc_results['foreground/stat']
else:
coinc_event_row.likelihood = 0.
coinc_event_table.append(coinc_event_row)
outdoc.childNodes[0].appendChild(coinc_event_table)

Expand Down

0 comments on commit fd06cfb

Please sign in to comment.