Example #1
0
parser.add_argument("-o",
                    "--output-subfolders",
                    default=[""],
                    nargs="+",
                    help="Output Subfolders")
parser.add_argument(
    "--no-publish",
    default=False,
    action="store_true",
    help="only produce overview.html but do not attempt to publish plots")

args = parser.parse_args()
logger.initLogger(args)

if ((len(args.input_dirs) != len(
        args.output_subfolders))) and not args.no_publish:
    log.fatal(
        "you tried to use " + str(len(args.input_dirs)) +
        " input directories but " + str(len(args.output_subfolders)) +
        " output directories. This might cause overwriting of files. Quit!")
    sys.exit(1)

if args.no_publish:
    args.output_subfolders = args.input_dirs

for input_dir, subfolder in zip(args.input_dirs, args.output_subfolders):
    PlotData.webplotting(www=subfolder,
                         output_dir=input_dir,
                         export_json=False,
                         no_publish=args.no_publish)
						category if len(args.categories) > 1 else ""
				))
				if not (config["output_dir"] in www_output_dirs):
					www_output_dirs.append(config["output_dir"])

				
				config.update(json_config)
				plot_configs.append(config)
	
	if log.isEnabledFor(logging.DEBUG):
		import pprint
		pprint.pprint(plot_configs)
	
	higgsplot.HiggsPlotter(list_of_config_dicts=plot_configs, list_of_args_strings=[args.args], n_processes=args.n_processes, n_plots=args.n_plots)

	if not args.www is None:
		for output_dir in www_output_dirs:
			from Artus.HarryPlotter.plotdata import PlotData
			subpath =os.path.normpath(output_dir).split("/")[-1]
			output_filenames = []
			for config in plot_configs:
				if(subpath in config["output_dir"]):
					output_filenames.append(os.path.join(output_dir, config["x_expressions"][0]+ ".png"))
			
			PlotData.webplotting(
			             www = args.www if(subpath == "control_plots") else os.path.join(args.www, subpath),
			             output_dir = output_dir,
			             export_json = False,
			             output_filenames = output_filenames
			             )
Example #3
0
        print

    # it's not pretty but it works :)
    if not args.www is None:
        from Artus.HarryPlotter.plotdata import PlotData
        for output_dir in www_output_dirs_postfit:
            subpath = os.path.normpath(output_dir).split("/")[-1]
            output_filenames = []
            for config in postfit_plot_configs:
                if (output_dir in config["output_dir"]
                        and not config["filename"] in output_filenames):
                    output_filenames.append(
                        os.path.join(output_dir, config["filename"] + ".png"))
            PlotData.webplotting(www=args.www if
                                 (subpath == "tauEsStudies_datacards") else
                                 os.path.join(args.www, subpath),
                                 output_dir=output_dir,
                                 export_json=False,
                                 output_filenames=output_filenames)
        for output_dir in www_output_dirs_ptbin:
            subpath = os.path.normpath(output_dir).split("/")[-1]
            output_filenames = []
            for config in ptbin_plot_configs:
                if (output_dir in config["output_dir"]
                        and not config["filename"] in output_filenames):
                    output_filenames.append(
                        os.path.join(output_dir, config["filename"] + ".png"))
            PlotData.webplotting(www=args.www if
                                 (subpath == "tauEsStudies_datacards") else
                                 os.path.join(args.www, subpath),
                                 output_dir=output_dir,
                                 export_json=False,
Example #4
0
import Artus.Utility.logger as logger
log = logging.getLogger(__name__)
import sys

from Artus.HarryPlotter.plotdata import PlotData
print sys.argv[1]
import argparse
parser = argparse.ArgumentParser(description="Make Data-MC control plots.",
                                 parents=[logger.loggingParser])
parser.add_argument("-i", "--input-dirs", required=True, nargs="+",
                    help="Input directories")
parser.add_argument("--output-subfolders", default=[""], nargs="+",
                    help="Output Subfolders")
parser.add_argument("--no-publish", default=False, action="store_true", help="only produce overview.html but do not attempt to publish plots")
args = parser.parse_args()
logger.initLogger(args)

if(args.input_dirs > 0):
	if(len(args.input_dirs) != len(args.output_subfolders)) and not args.no_publish:
		log.fatal("you tried to use " + str(len(args.input_dirs)) + " input directoreis but " + str(len(args.output_subfolders)) + ". This might cause overwriting of files.")
		sys.exit()
	elif args.no_publish:
		args.output_subfolders = args.input_dirs
for input_dir, subfolder in zip(args.input_dirs, args.output_subfolders):
	PlotData.webplotting(
	              www = subfolder,
	             output_dir = input_dir,
	              export_json = False,
	              no_publish = args.no_publish
	              )