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
+ 1
9
Compare changes
  • Side-by-side
  • Inline
@@ -63,8 +63,6 @@ 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])
@@ -74,10 +72,4 @@ for key, group in groupby(sorted(urls, key = lambda x: CacheEntry.from_T050017(x
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)
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])
horizon_distance.savefig(output, figsize = options.fig_size, title = title)
Loading