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

gstlal_inspiral_reset_likelihood: make zero lag counts integers

parent 260201e0
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,13 @@ for ifo in like_segs.keys():
# Make the observed counts match the background sample but with the correct normalization
for instruments in zlike_rd.background_likelihood_rates:
zlike_rd.zero_lag_likelihood_rates[instruments].array[:] = like_rd.background_likelihood_rates[instruments].array[:] / like_rd.background_likelihood_rates[instruments].array.sum() * zlike_rd.zero_lag_likelihood_rates[instruments].array.sum() / far.get_live_time(like_segs) * far.get_live_time(new_like_segs)
# make the counts integers
zlike_rd.zero_lag_likelihood_rates[instruments].array[zlike_rd.zero_lag_likelihood_rates[instruments].array < 1.] = 0.
if options.verbose:
print >> sys.stderr, "replacing %s with %d zero lag counts" % (str(instruments), zlike_rd.zero_lag_likelihood_rates[instruments].array.sum())
if zlike_rd.zero_lag_likelihood_rates[instruments].array.sum() <= 100:
raise ValueError("Must have greater than 100 counts in zero lag, have: %d" % zlike_rd.zero_lag_likelihood_rates[instruments].array.sum())
# write out the background file
xmldoc = ligolw.Document()
......
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