Ejemplo n.º 1
0
def preprocess(in_files, raw_input):
    def preprocess_each(in_file, raw_input):
        out_file = os.path.basename(in_file).split('.')[0]
        os_sys("collectl -p {0} -P -oU -scdmn --sep 9 > {1}/{2}".format(in_file, raw_input, out_file))
        print("Save preprocessed file %s to %s" % (out_file, os.path.relpath(raw_input)))
        return os.path.join(raw_input, out_file)

    os_sys("mkdir -p %s" % raw_input)
    return [preprocess_each(in_file, raw_input) for in_file in in_files]
Ejemplo n.º 2
0
def preprocess(in_files, raw_input):
    preprocessed = []
    cmd = ""
    for in_file in in_files:
        out_file = os.path.basename(in_file).split('.')[0]
        cmd = "{3} echo 'Save preprocessed file {2} to {4}' && collectl -p {0} -P -oU -scdmn --sep 9 > {1}/{2} &".format(
            in_file, raw_input, out_file, cmd, os.path.relpath(raw_input))
        preprocessed.append(os.path.join(raw_input, out_file))

    os_sys("mkdir -p {0}".format(raw_input))
    cmd = "{0} wait".format(cmd)
    os_sys(cmd)
    return preprocessed
Ejemplo n.º 3
0
def main(args):
    conf = Conf(args)

    if args.raw_input:
        conf.in_files = preprocess(conf.in_files, os.path.dirname(os.path.abspath(args.input[0])) + "/dat")

    if args.to_plot is False:
        return

    # Create output dir in case it does not exist
    os_sys('mkdir -p %s' % conf.output)

    Painter(conf).plot_all()
Ejemplo n.º 4
0
def main(args):
    # Create output dir in case it does not exist
    os_sys('mkdir -p %s' % args.output)

    Painter(args).plot_all()