Exemplo n.º 1
0
            for o in [s.replace("correlator","config") for s in toosmall]:
                if o in outliercount:
                    outliercount[o] += 1
                else:
                    outliercount[o] = 1
        else:
            outlierfile.write("\n")
    for config,count in outliercount.items():
        outlierfile.write("{} has outliers on {} of {} times\n".format(config,count,len(data.index)))
        if count == len(data.index):
            logging.error("Config {} has outliers on all times!!".format(config))

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="plot a histogram of a file for a single time")
    parser.add_argument("-v", "--verbose", action="store_true",
                        help="increase output verbosity")
    parser.add_argument("-o", "--output-stub", type=str, required=True,
                        help="stub of name to write output to")
    parser.add_argument('datafile', metavar='f', type=str, help='file to plot')
    args = parser.parse_args()

    if args.verbose:
        logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
        logging.debug("Verbose debuging mode activated")
    else:
        logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)

    data = pandas_reader.read_configcols_paraenformat(args.datafile)

    sanity_check(data)
Exemplo n.º 2
0
        if not ops:
            logging.error("Error: no operators found")
            parser.print_help()
            parser.exit()
        args.operators = ops
    else:
        ops = readops(args.operators)
        logging.debug("found operators: {}".format(','.join(ops)))
        args.operators = ops

    cor_matrix = {}
    for snk in args.operators:
        for src in args.operators:
            filename = args.input_dir + args.filewild.format(snk, src)
            logging.info("reading {}".format(filename))
            cor_matrix[snk+src] = pandas_reader.read_configcols_paraenformat(filename)

    correlator_pannel = pd.Panel(cor_matrix)

    length = correlator_pannel.shape[0]
    n = int(np.sqrt(length))
    B = np.matrix(np.reshape(correlator_pannel.major_xs(args.time).mean().values, (n, n)))
    B = hermitionize(B)

    evals = LA.eigvalsh(B)
    logging.info("eigenvalues are {}".format(",".join(map(str, evals))))
    if args.output:
        write_eigenvalues(evals)

    meval = max(evals)
    logging.info("max eigen {}".format(meval))
Exemplo n.º 3
0
        args.operators = ops

    if not args.principle and not args.tstar:
        logging.error("tstar required, unless doing princple")
        parser.print_help()
        parser.exit()

    cor_matrix = {}
    cor_matrix_multi = {}
    cor_matrix_ave = {}
    for snk in args.operators:
        for src in args.operators:
            filename = args.input_dir + args.filewild.format(snk, src)
            logging.info("reading {}".format(filename))
            try:
                tmpcor = pandas_reader.read_configcols_paraenformat(filename)
            except:
                tmpcor = pandas_reader.read_configcols_normal(filename)


            cor_matrix[snk+src] = tmpcor


    p = pd.Panel(cor_matrix)

    if args.returnmaxeigen:
        logging.info("just returning the max eigen")
        print diagonalize(p, args.tnaught, args.tstar, generalized=args.generalized)

    if args.principle:
        diag = principle(p, args.tnaught, generalized=args.generalized)