Exemplo n.º 1
0
def setup():
    test_file = "examples/pythia/LHC/out01"
    from mcviz.options import parse_options
    parser, args = parse_options([])
    args.filename = test_file
    global event_graph, view_graph
    event_graph = EventGraph.from_pythia_log(args)
    view_graph = GraphView(event_graph)
Exemplo n.º 2
0
def get_image(file_name):
    """Serve image back to user"""
    name, _, _ = file_name.rpartition(".")
    APP.logger.info("Rendering image %s", name)
    APP.logger.debug(request.args)
    arg_list = [e for pair in request.args.iteritems(True) for e in pair]
    APP.logger.debug(arg_list)
    _, args = parse_options(arg_list)
    APP.logger.debug(args)
    args.filename = get_resource_path('UPLOAD_FOLDER', name)
    args.output_file = get_resource_path('RENDER_FOLDER', file_name)

    event_graph = EventGraph.load(args)
    workspace = GraphWorkspace(name, event_graph)
    workspace.load_tools(args)
    workspace.run()

    APP.logger.info("Rendering %s done", name)
    return send_from_directory(APP.config['RENDER_FOLDER'], file_name)
Exemplo n.º 3
0
def get_image(file_name):
    """Serve image back to user"""
    name, _, _ = file_name.rpartition(".")
    APP.logger.info("Rendering image %s", name)
    APP.logger.debug(request.args)
    arg_list = [e for pair in request.args.iteritems(True) for e in pair]
    APP.logger.debug(arg_list)
    _, args = parse_options(arg_list)
    APP.logger.debug(args)
    args.filename = get_resource_path('UPLOAD_FOLDER', name)
    args.output_file = get_resource_path('RENDER_FOLDER', file_name)

    event_graph = EventGraph.load(args)
    workspace = GraphWorkspace(name, event_graph)
    workspace.load_tools(args)
    workspace.run()

    APP.logger.info("Rendering %s done", name)
    return send_from_directory(APP.config['RENDER_FOLDER'], file_name)
Exemplo n.º 4
0
def setup():
    test_file = "inputs/pythia01.out"
    from mcviz.options import parse_options
    options, args = parse_options([])
    global event_graph
    event_graph = EventGraph.from_pythia_log(test_file, options)