Commit ccaa8eb3 authored by Leo Pound Singer's avatar Leo Pound Singer

bayestar_aggregate_found_injections: add --format option

Original: 1b70c0a63ee6807f964b13ceb9440f82240504f1
parent 85df63b9
......@@ -37,6 +37,8 @@ parser.add_argument(
default=95, help='If all inputs files have the same number of '
'samples, overlay binomial confidence bands for this percentage on '
'the P--P plot [default: %(default)s]')
parser.add_argument(
'--format', default='pdf', help='Matplotlib format [default: %(default)s]')
parser.add_argument(
'input', type=argparse.FileType('rb'), nargs='+',
help='Name of input file generated by bayestar_aggregate_found_injections')
......@@ -245,24 +247,24 @@ for i, (bin_edge, subdir, title) in enumerate(zip(bin_edges, bin_names, bin_titl
ax1.grid()
if len(datasets) > 1:
ax1.legend(loc='lower right')
fig1.savefig('searched_prob.pdf')
fig1.savefig('searched_prob.' + opts.format)
# Finish and save plot 2.
pb.update(i * 7 + 1)
ax2.grid()
fig2.savefig('searched_area_hist.pdf')
fig2.savefig('searched_area_hist.' + opts.format)
# Finish and save plot 3.
pb.update(i * 7 + 2)
if have_offset:
ax3.grid()
fig3.savefig('offset_hist.pdf')
fig3.savefig('offset_hist.' + opts.format)
# Finish and save plot 4.
pb.update(i * 7 + 3)
if have_runtime:
ax4.grid()
fig4.savefig('runtime_hist.pdf')
fig4.savefig('runtime_hist.' + opts.format)
plt.close()
# Finish and save plot 5.
......@@ -278,7 +280,7 @@ for i, (bin_edge, subdir, title) in enumerate(zip(bin_edges, bin_names, bin_titl
ax5.grid()
if len(datasets) > 1:
ax5.legend(loc='lower right')
fig5.savefig('searched_prob_dist.pdf')
fig5.savefig('searched_prob_dist.' + opts.format)
plt.close()
# Finish and save plot 6.
......@@ -294,13 +296,13 @@ for i, (bin_edge, subdir, title) in enumerate(zip(bin_edges, bin_names, bin_titl
ax6.grid()
if len(datasets) > 1:
ax6.legend(loc='lower right')
fig6.savefig('searched_prob_vol.pdf')
fig6.savefig('searched_prob_vol.' + opts.format)
plt.close()
# Finish and save plot 7.
pb.update(i * 7 + 6)
ax7.grid()
fig7.savefig('searched_vol_hist.pdf')
fig7.savefig('searched_vol_hist.' + opts.format)
# Go back to starting directory.
os.chdir(cwd)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment