blimpy/guppi.py
def cmd_tool(args=None):
    """ Command line tool for plotting and viewing info on guppi raw files """

    from argparse import ArgumentParser

    parser = ArgumentParser(description="Command line utility for creating spectra from GuppiRaw files.")

    parser.add_argument('filename', type=str, help='Name of file to read')
    parser.add_argument('-o', dest='outdir', type=str, default='./', help='output directory for PNG files')
    args = parser.parse_args()

    r = GuppiRaw(args.filename)

    r.print_stats()
    bname = os.path.splitext(os.path.basename(args.filename))[0]
    bname = os.path.join(args.outdir, bname)
    r.plot_histogram(filename="%s_hist.png" % bname)
    r.plot_spectrum(filename="%s_spec.png" % bname)
def cmd_tool(args=None):
    from argparse import ArgumentParser

    parser = ArgumentParser(description="Command line utility for creating spectra from GuppiRaw files.")

    parser.add_argument('filename', type=str, help='Name of file to read')
    parser.add_argument('-o', dest='outdir', type=str, default='./', help='output directory for PNG files')
    args = parser.parse_args()

    r = GuppiRaw(args.filename)

    r.print_stats()
    bname = os.path.splitext(os.path.basename(args.filename))[0]
    bname = os.path.join(args.outdir, bname)
    r.plot_histogram(filename="%s_hist.png" % bname)
    r.plot_spectrum(filename="%s_spec.png" % bname)
def cmd_tool ( args = None ) : from argparse import ArgumentParser parser = ArgumentParser ( description = "Command line utility for creating spectra from GuppiRaw files." ) parser . add_argument ( 'filename' , type = str , help = 'Name of file to read' ) parser . add_argument ( '-o' , dest = 'outdir' , type = str , default = './' , help = 'output directory for PNG files' ) args = parser . parse_args ( ) r = GuppiRaw ( args . filename ) r . print_stats ( ) bname = os . path . splitext ( os . path . basename ( args . filename ) ) [ 0 ] bname = os . path . join ( args . outdir , bname ) r . plot_histogram ( filename = "%s_hist.png" % bname ) r . plot_spectrum ( filename = "%s_spec.png" % bname )
Command line tool for plotting and viewing info on guppi raw files
Command line tool for plotting and viewing info on guppi raw files