diff --git a/bin/pygrb/pycbc_pygrb_efficiency b/bin/pygrb/pycbc_pygrb_efficiency index 3e6356165fe..68cf8928293 100644 --- a/bin/pygrb/pycbc_pygrb_efficiency +++ b/bin/pygrb/pycbc_pygrb_efficiency @@ -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: @@ -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)