def main():
    cwd = os.getcwd()
    plot_json = utils.retrieve_and_validate_json(
        cwd, json_name='plot.json', schema_name='../plot-schema.json')
    data_paths = find_all_data_paths(cwd, plot_json)
    files = [str(f) for dp in data_paths for f in glob.glob(dp + '/*.dat')]
    pic_path = os.path.abspath(os.path.join(cwd, 'plots')) + '/'
    data = data_utils.load_and_clean_files(files, plot_json)
    #  TODO: (bcn 2017-02-22) make this steerable
    for idx, item in enumerate(data):
        if 'Analytic' in item[0]:
            data[idx][1][1] *= 1000
    for output in plot_json.get('output', []):
        data_to_show = data_utils.get_associated_plot_data_single(data, output)
        for data_item in data_to_show:
            for x in output.get('print_points', []):
                print x, data_utils.get_y_where_x(data_item, x)
    plot_this = partial(bcn_plot.plot, data=data, pic_path=pic_path)
    plots = plot_json['plots']
    if args.plot is not None:
        plots = [p for p in plots if args.plot in p['output_file']]
    if args.jobs > 1:
        pool = mp.Pool(processes=args.jobs)
        pool.map(plot_this, plots)
    else:
        map(plot_this, plots)
    print 'Done with all plots'
示例#2
0
def main():
    pic_path = os.path.abspath('./plots') + '/'
    data_path = os.path.abspath('./scan-results')
    files = glob.glob(data_path + '/*.dat')
    plot_json = load_json('plot.json')
    data = data_utils.load_and_clean_files(files)
    pool = mp.Pool(processes=3)
    plot_this = partial(bcn_plot.plot,
                        data=data,
                        pic_path=pic_path,
                        linestyle_decider=ls_decider,
                        pretty_label=pretty_label)
    #output_file='tth-scan')
    pool.map(plot_this, plot_json['plots'])
示例#3
0
def main():
    pic_path = os.path.abspath('./plots') + '/'
    data_path = os.path.abspath('./scan-results')
    files = glob.glob(data_path + '/*.dat')
    plot_json = ut.retrieve_and_validate_json(
        './', json_name='plot.json', schema_name='../plot-schema.json')
    data = dt.load_and_clean_files(files, plot_json)
    pool = mp.Pool(processes=3)
    plot_this = partial(bcn_plot.plot,
                        plot_extra=plot_x_axis,
                        data=data,
                        pic_path=pic_path,
                        linestyle_decider=ls_decider,
                        pretty_label=pretty_label)
    pool.map(plot_this, plot_json['plots'])
示例#4
0
def main():
    pic_path = os.path.abspath('./plots') + '/'
    data_path = os.path.abspath('./scan-results')
    files = glob.glob(data_path + '/*.dat')
    plot_json = load_json('plot.json')
    data = data_utils.load_and_clean_files(files)
    for index, item in enumerate(data):
        print 'name: ', data[index][0]
        print 'x: ', data[index][1][0]
        print 'y: ', data[index][1][1]
    pool = mp.Pool(processes=3)
    plot_this = partial(bcn_plot.plot,
                        plot_extra=plot_x_axis,
                        data=data,
                        pic_path=pic_path,
                        linestyle_decider=ls_decider,
                        pretty_label=pretty_label)
    pool.map(plot_this, plot_json['plots'])
示例#5
0
def main():
    print 'Start'
    pic_path = os.path.abspath('./plots') + '/'
    data_path = os.path.abspath('./scan-results')
    data_path2 = os.path.abspath('../ee_tt/scan-results')
    files = glob.glob(data_path + '/*.dat')
    files += glob.glob(data_path2 + '/*.dat')
    data = data_utils.load_and_clean_files(files)
    for idx, item in enumerate(data):
        if 'Analytic' in item[0]:
            data[idx][1][1] *= 1000
    plot_this = partial(bcn_plot.plot,
                        data=data,
                        pic_path=pic_path,
                        linestyle_decider=ls_decider,
                        pretty_label=pretty_label)
    plot_json = load_json('plot.json')
    if parallel:
        pool = mp.Pool(processes=4)
        pool.map(plot_this, plot_json['plots'])
    else:
        map(plot_this, plot_json['plots'])