from MCS_interface import MCS_interface #### rewriteconfig = True nofitnum = False redofromscratch = True #### if rewriteconfig == True: psfstars = star.readmancat(psfstarcat) nbrpsf = len(psfstars) starscouplelist = repr([(int(s.x), int(s.y)) for s in psfstars]) config_template = justread(os.path.join(configdir, "template_pyMCS_psf_config.py")) # Select images to treat db = KirbyBase() if thisisatest : print "This is a test run." images = db.select(imgdb, ['gogogo', 'treatme', 'testlist',psfkeyflag], [True, True, True, True], returnType='dict', sortFields=['setname', 'mjd']) elif update: print "This is an update." images = db.select(imgdb, ['gogogo', 'treatme', 'updating', psfkeyflag], [True, True, True, True], returnType='dict', sortFields=['setname', 'mjd']) askquestions=False else : images = db.select(imgdb, ['gogogo', 'treatme',psfkeyflag], [True, True, True], returnType='dict', sortFields=['setname', 'mjd']) print "I will build the PSF of %i images." % len(images) ncorestouse = forkmap.nprocessors() #ncorestouse = multiprocessing.cpu_count()