Skip to content
Snippets Groups Projects

Plot horizon distance from ranking statistics

Merged ChiWai Chan requested to merge plot_psd_horizon into master
1 unresolved thread
1 file
+ 10
1
Compare changes
  • Side-by-side
  • Inline
@@ -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])
Loading