shots = qrange.parse_range(args.range)
        args.shots = shots
        if args.average == False:
            for shot in shots:
                analyze_shot(int(shot), args)
            print ""
            exit(0)
        else:
            analyze_shot(int(shots[0]), args, average=True)
            print ""
            exit(0)

    path = os.getcwd()
    exprs = ["/????atoms.manta", "/????atoms.fits", "/????atoms_andor2.fits"]

    last = monitordir.get_last_shot(path, exprs)
    # print last
    current = monitordir.get_all_shots(path, exprs)
    # print current
    analyze_shot(last, args)

    from multiprocessing import Pool

    def a(x):
        return analyze_shot(x, args)

    def parallel_analyze(new):
        pool = Pool(4)
        ret = pool.map(a, new)
        pool.close()
        pool.join()