def cmd_tool(args=None):
from argparse import ArgumentParser<EOL>parser = ArgumentParser(description="<STR_LIT>")<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>',  default='<STR_LIT>', dest='<STR_LIT>', type=str,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT:filename>', type=str,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>', default=None, dest='<STR_LIT>', type=float,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>', default=None, dest='<STR_LIT>', type=float,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>', default=None, dest='<STR_LIT>', type=int,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>', default=None, dest='<STR_LIT>', type=int,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store_true>', default=False, dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store_true>', default=False, dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store>', default='<STR_LIT>', dest='<STR_LIT>', type=str,<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT:store_true>', default=False, dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', action='<STR_LIT>', default=True, dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT:-c>', action='<STR_LIT:store_true>', default=False, dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>args = parser.parse_args()<EOL>filename = args.filename<EOL>load_data = not args.info_only<EOL>wtp = args.what_to_plot<EOL>if not wtp or '<STR_LIT:s>' in wtp:<EOL><INDENT>if args.t_start == None:<EOL><INDENT>t_start = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>t_start = args.t_start<EOL><DEDENT>t_stop  = t_start + <NUM_LIT:1><EOL>if args.average:<EOL><INDENT>t_start = None<EOL>t_stop  = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>t_start = args.t_start<EOL>t_stop  = args.t_stop<EOL><DEDENT>if args.info_only:<EOL><INDENT>args.blank_dc = False<EOL>args.calibrate_band_pass = False<EOL><DEDENT>fil = Filterbank(filename, f_start=args.f_start, f_stop=args.f_stop,<EOL>t_start=t_start, t_stop=t_stop,<EOL>load_data=load_data,blank_dc=args.blank_dc,<EOL>cal_band_pass=args.calibrate_band_pass)<EOL>fil.info()<EOL>if not args.info_only:<EOL><INDENT>if args.what_to_plot == "<STR_LIT:w>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:8>, <NUM_LIT:6>))<EOL>fil.plot_waterfall(f_start=args.f_start, f_stop=args.f_stop)<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT:s>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:8>, <NUM_LIT:6>))<EOL>fil.plot_spectrum(logged=True, f_start=args.f_start, f_stop=args.f_stop, t='<STR_LIT:all>')<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:8>, <NUM_LIT:6>))<EOL>fil.plot_spectrum_min_max(logged=True, f_start=args.f_start, f_stop=args.f_stop, t='<STR_LIT:all>')<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT:k>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:8>, <NUM_LIT:6>))<EOL>fil.plot_kurtosis(f_start=args.f_start, f_stop=args.f_stop)<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT:t>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:8>, <NUM_LIT:6>))<EOL>fil.plot_time_series(f_start=args.f_start, f_stop=args.f_stop,orientation='<STR_LIT:h>')<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT:a>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:12>, <NUM_LIT:9>),facecolor='<STR_LIT>')<EOL>fil.plot_all(logged=True, f_start=args.f_start, f_stop=args.f_stop, t='<STR_LIT:all>')<EOL><DEDENT>elif args.what_to_plot == "<STR_LIT>":<EOL><INDENT>plt.figure("<STR_LIT>", figsize=(<NUM_LIT:12>, <NUM_LIT:9>),facecolor='<STR_LIT>')<EOL>fil.plot_all(logged=True, f_start=args.f_start, f_stop=args.f_stop, t='<STR_LIT:all>',kurtosis=False)<EOL><DEDENT>if args.plt_filename != '<STR_LIT>':<EOL><INDENT>plt.savefig(args.plt_filename)<EOL><DEDENT>if not args.save_only:<EOL><INDENT>if '<STR_LIT>' in os.environ.keys():<EOL><INDENT>plt.show()<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>
Command line tool for plotting and viewing info on filterbank files