diff --git a/gwinc/__main__.py b/gwinc/__main__.py index b327a7895d30dd40d8c97c5ffd15ac844a04b663..e7a977899c10872730f40e6ab971a512bf5da2d3 100644 --- a/gwinc/__main__.py +++ b/gwinc/__main__.py @@ -114,6 +114,9 @@ parser.add_argument( parser.add_argument( 'IFO', help="IFO name or path") +parser.add_argument( + 'subbudget', nargs='?', + help="subbudget to plot; can be nested (e.g. 'Thermal.Substrate')") def main(): @@ -251,11 +254,6 @@ def main(): logger.info("calculating budget...") trace = budget.run(freq=freq) - if args.title: - plot_style['title'] = args.title - else: - plot_style['title'] = "GWINC Noise Budget: {}".format(name) - if args.range: logger.info("calculating inspiral ranges...") metrics, H = inspiral_range.all_ranges(freq, trace.psd, **RANGE_PARAMS) @@ -275,6 +273,15 @@ def main(): else: subtitle = None + if args.subbudget: + trace = trace[args.subbudget] + name += f': {args.subbudget}' + + if args.title: + plot_style['title'] = args.title + else: + plot_style['title'] = "GWINC Noise Budget: {}".format(name) + ########## # interactive