for filt in opts.filters:

        config = LR.select_config(opts.configs, filt)

        # Are there visits to load
        if not os.path.exists(filt + ".list"):
            print("WARNING: No file (no visit) for filter", filt)
            continue

        # Get the list of visits
        dataids = N.loadtxt(filt + ".list", dtype='str')
        visits = list(set([dataid[1].split('=')[1] for dataid in dataids]))
        print("INFO: %i visits loaded: " % len(visits), visits)

        # How many jobs should we be running (and how many visit in each?)?
        njobs = LR.job_number(visits, opts.mod, opts.max)

        # Reorganize the visit list in sequence
        visits = LR.organize_items(visits, njobs)

        # Loop over the visit file
        numscript = 1
        for i, visit in enumerate(visits):
            cmd = build_cmd(visit,
                            filt,
                            i,
                            input=opts.output,
                            output=opts.output)

            # Only submit the job if asked
            prefix = "visit_makeFpSummary_%03d_script" % numscript
Ejemplo n.º 2
0
    usage = """%prog [option]"""

    description = """Run jointcal for a given list of filters"""

    opts, args = LR.standard_options(usage=usage, description=description)

    input = "pardir/output"
    output = "pardir/output"
    config = "jointcalConfig.py"

    patches = np.loadtxt('patches.txt', dtype='str', unpack=True)
    tracts = [s.split('=')[1] for s in set(patches[0])]

    # How many jobs should we be running (and how many tract in each?)?
    njobs = LR.job_number(tracts, opts.mod, opts.max)

    tracts_visits = {}
    for tract in tracts:
        tracts_visits[tract] = {}
        for filt in opts.filters:
            tracts_visits[tract][filt] = []
            flist = glob.glob(filt + '_*_patches.list')
            for clist in flist:
                ctracts = [
                    tr.split('=')[1]
                    for tr in np.loadtxt(clist, dtype='bytes').astype(str)[:,
                                                                           0]
                ]
                if tract in list(set(ctracts)):
                    tracts_visits[tract][filt].append(clist.split('_')[1])
Ejemplo n.º 3
0
            continue

        # default options
        opts.input = "pardir/output"
        opts.output = "pardir/output"

        # Get the list of patches
        patches = [
            " ".join(p)
            for p in N.loadtxt("patches_" + filt +
                               ".txt", dtype='bytes').astype(str)
        ]
        print("INFO: %i patches loaded: " % len(patches), "e.g.", patches[0])

        # How many jobs should we be running (and how many visit in each?)?
        njobs = LR.job_number(patches, opts.mod, opts.max)

        # Reorganize the visit list in consequence
        patches = LR.organize_items(patches, njobs)

        # Loop over the patches sub lists
        for i, ps in enumerate(patches):

            # Build the command line and other things
            cmd = build_cmd("@scripts/%s/patches_%03d.list" % (filt, i + 1),
                            config, filt, opts.input, opts.output)

            # Only submit the job if asked
            prefix = "patches_%03d" % (i + 1)
            LR.submit(cmd,
                      prefix,