Skip to content
Snippets Groups Projects
Commit 32a9c2d2 authored by ChiWai Chan's avatar ChiWai Chan
Browse files

gstlal_inspiral_plot_rankingstats_horizon: add subplot title and restrict the...

gstlal_inspiral_plot_rankingstats_horizon: add subplot title and restrict the horizon distance to the global max and min horizon distance from all files so that it's easier to compare.
parent 752c542c
No related branches found
No related tags found
1 merge request!114Plot horizon distance from ranking statistics
......@@ -63,12 +63,21 @@ for f in files:
urls.append(f)
outdir = Path(options.outdir)
tasks = {}
gmaxh = -1e32
for key, group in groupby(sorted(urls, key = lambda x: CacheEntry.from_T050017(x).description), lambda x: CacheEntry.from_T050017(x).description):
rankfiles = list(group)
ce = CacheEntry.from_T050017(rankfiles[0])
title = f"Horizon Distance for Bin {ce.description.replace('_MARG_DIST_STATS', '')}"
desc = ce.description.replace('MARG_DIST_STATS', 'HORIZON')
start = ce.segment[0]
duration = ce.segment[1] - ce.segment[0]
output = outdir / f"{ce.observatory}-{desc}-{start}-{duration}.{options.format}"
horizon_distance = horizon.HorizonDistance.from_rankingstats(rankfiles, verbose = options.verbose)
horizon_distance.savefig(output, options.fig_size)
tasks[horizon_distance] = [output, title]
# update global max horizon distance
gmaxh = max(horizon_distance.max, gmaxh)
# save figure
for horizon_distance, args in tasks.items():
horizon_distance.savefig(args[0], figsize = options.fig_size, limits = [0.001, gmaxh*1.05], title = args[1])
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