# 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
            LR.submit(cmd,
                      prefix,
                      filt,
Example #2
0
    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])

    # Reorganize the tract list in sequence
    alltracts = LR.organize_items(tracts, njobs)

    # Loop over filters
    for filt in opts.filters:
        for i, tracts in enumerate(alltracts):
            cmd = ""
            for tract in tracts:
                newfile = open('%s_%s.list' % (filt, str(tract)), 'w')
                for visit in tracts_visits[tract][filt]:
                    newfile.write('--id tract=%s visit=%s\n' %
                                  (str(tract), str(visit)))
                newfile.close()
                cmd += "jointcal.py %s --output %s @%s_%s.list --configfile %s --clobber-versions -L DEBUG\n" % \
                       (input, output, filt, str(tract), config)

            # Only submit the job if asked
Example #3
0
        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,
                      filt,
                      autosubmit=opts.autosubmit,
                      queue=opts.queue,