Esempio n. 1
0
def getConfigFromArguments(argv=None):
    default = os.path.join(os.getenv("PIPETTE_DIR"), "policy",
                           "ProcessCcdDictionary.paf")
    parser = pipOptions.OptionParser()
    parser.add_option("-r",
                      "--rerun",
                      default=os.getenv("USER", default="rerun"),
                      dest="rerun",
                      help="rerun name (default=%default)")
    parser.add_option("-f",
                      "--frame",
                      dest="frame",
                      help="visit to run (default=%default)")
    parser.add_option("-c",
                      "--ccd",
                      dest="ccds",
                      action="append",
                      help="CCD to run (default=%default)")

    config, opts, args = parser.parse_args([default], argv=argv)
    if (len(args) > 0  # or opts.instrument is None
            or opts.rerun is None or opts.frame is None or opts.ccds is None):

        parser.print_help()
        print "argv was: %s" % (argv)
        return None, None, None

    return config, opts, args
Esempio n. 2
0
def getConfigFromArguments(argv=None):
    default = os.path.join(os.getenv("PIPETTE_DIR"), "policy",
                           "ProcessCcdDictionary.paf")
    parser = pipOptions.OptionParser()
    parser.add_option("-r",
                      "--rerun",
                      default=os.getenv("USER", default="rerun"),
                      dest="rerun",
                      help="rerun name (default=%default)")
    parser.add_option("-f",
                      "--frames",
                      dest="frames",
                      help="visits to run, colon-delimited")
    parser.add_option("-T",
                      "--threads",
                      type="int",
                      dest="threads",
                      help="Number of threads")

    config, opts, args = parser.parse_args([default], argv=argv)
    if (len(args) > 0  # or opts.instrument is None
            or opts.rerun is None or opts.frames is None
            or opts.threads is None):

        parser.print_help()
        print "argv was: %s" % (argv)
        return None, None, None

    return config, opts, args
Esempio n. 3
0
            if submit:
                queue.sub(
                    basename,
                    basename=basename,
                    config=config,
                    dataId=dataId,
                    catalog=catalog,
                )
            else:
                print "Not queuing %s: dataId=%s" % (basename, dataId)

    return


if __name__ == "__main__":
    parser = pipOptions.OptionParser()
    parser.add_option("-r",
                      "--rerun",
                      default=os.getenv("USER", default="rerun"),
                      dest="rerun",
                      help="rerun name (default=%default)")
    parser.add_option("-f",
                      "--frames",
                      default=None,
                      dest="frames",
                      help="colon separated frames to run (default=%default)")
    parser.add_option("-c",
                      "--ccds",
                      default="0:1:2:3:4:5:6:7:8:9",
                      dest="ccds",
                      help="colon separated CCDs to run (default=%default)")