Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Francesco Pannarale <francesco.pannarale@ligo.org>
  • Loading branch information
ETVincent and pannarale authored Oct 21, 2024
1 parent 0ce8d86 commit 4544db0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/pygrb/pycbc_pygrb_efficiency
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ if opts.exclusion_dist_output_file:
excl_dist_dict['50%'] = excl_dist[50]
excl_dist_dict['90%'] = excl_dist[90]
with open(opts.exclusion_dist_output_file, 'w') as excl_dist_file:
json.dump(excl_dist_dict, excl_dist_file)
json.dump(excl_dist, excl_dist_file)

# Plot efficiency using loudest foreground
if opts.onsource_output_file:
Expand Down Expand Up @@ -642,15 +642,15 @@ if opts.onsource_output_file:
ax.set_ylabel("Fraction of injections found louder than " +
"loudest foreground")
ax.set_xlabel("Distance (Mpc)")
ax.plot([excl_dist[90]], [0.9], 'gx')
ax.plot([excl_dist["90%"]], [0.9], 'gx')
ax.set_ylim([0, 1])
ax.set_xlim(0, 2.*upper_dist - lower_dist)
plot_title = "Exclusion distance - "+inj_set_name
plot_caption = "Injection recovery efficiency using "
plot_caption += "BestNR as detection statistic. "
plot_caption += "Injections louder than loudest foreground trigger.\n"
plot_caption += f" 90%% exclusion distance: {excl_dist[90]} Mpc\n"
plot_caption += f" 50%% sensitive distance: {excl_dist[50]} Mpc"
plot_caption += f" 90%% exclusion distance: {excl_dist['90%']} Mpc\n"
plot_caption += f" 50%% sensitive distance: {excl_dist['50%']} Mpc"
fig_path = opts.onsource_output_file
save_fig_with_metadata(fig, fig_path, cmd=' '.join(sys.argv),
title=plot_title, caption=plot_caption)
Expand Down

0 comments on commit 4544db0

Please sign in to comment.