Skip to content

Commit

Permalink
Live single fits combined bug (gwastro#4449)
Browse files Browse the repository at this point in the history
* Take precentile of rate, not count

* make change to mean as well

* Fix to label

* Update bin/live/pycbc_live_plot_combined_single_fits

Co-authored-by: Tito Dal Canton <tito@dalcanton.it>

* Update bin/live/pycbc_live_combine_single_fits

---------

Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
  • Loading branch information
2 people authored and bhooshan-gadre committed Mar 1, 2024
1 parent d1ec6f6 commit eef6c84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bin/live/pycbc_live_combine_single_fits
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ for ifo in args.ifos:
cons_alpha = np.percentile(a, 100 - args.conservative_percentile)
cons_alphas_out[ifo][counter] = cons_alpha
alphas_out[ifo][counter] = mean_alpha
cons_count = np.percentile(c, args.conservative_percentile)
cons_counts_out[ifo][counter] = cons_count * len(c)
counts_out[ifo][counter] = c.sum()
# To get the count values, we need to convert to rates and back again
r = c / l_times[ad_order]
cons_rate = np.percentile(r, args.conservative_percentile)
cons_counts_out[ifo][counter] = cons_rate * l_times[ad_order].sum()
counts_out[ifo][counter] = np.mean(r) * l_times[ad_order].sum()

fout_ifo[f'separate_fits/bin_{counter:d}/fit_coeff'] = a
fout_ifo[f'separate_fits/bin_{counter:d}/counts'] = c
Expand Down
2 changes: 1 addition & 1 deletion bin/live/pycbc_live_plot_combined_single_fits
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ for ifo in ifos:
count_labels = [l.get_label() for l in count_lines]
ax_count.legend(count_lines, count_labels, loc='lower center',
ncol=5, bbox_to_anchor=(0.5, 1.01))
ax_count.set_ylabel('Counts per live time')
ax_count.set_ylabel('Rate of triggers above fit threshold [s$^{-1}$]')

for ax in [ax_count, ax_alpha]:
ax.set_xticks(xtix)
Expand Down

0 comments on commit eef6c84

Please sign in to comment.