args = sys.argv obj = args[1] filt = args[2] if len(args)>3: instrUsed = str(args[3]) else: instrUsed = "ARIES" ### Find the directory and file fitsDir = ao.koiFilterDir(obj,filt,instrUsed) fitsFile = ao.finalKOIimageFile(obj,filt) ### Read settings file to get plate scale settingsDict={} settingsFile = ao.koiDir(obj,instrUsed)+"settings_"+obj+".tsv" print settingsFile+"\n" settingsDict=ao.readSettingsFile(settingsFile) #### Change if some other Speckle instrument besides Steve Howell's first one (i.e., if Gemini) if instrUsed == "Speckle": try: plateScale = eval(settingsDict['Plate_scale_Speckle']) except: print "\n\nWARNING! using hardcoded plate scale in magLimits.py\n\n" plateScale = 0.0228156 #### Should we ever have plate scales differ on different filters, this will need to change else: plateScale = eval(settingsDict['Plate_scale_Ks'])
sys.exit("I don't know what objects to analyze. Please run step5-objects.py") ## Now change to the night directory os.chdir(nightPath) ## Copy all files to objects/OBJECT/FILTER/ g = open("summary_"+useNight+".txt","w") for nn,ff in enumerate(useObjList): elems = ff.split("_") prefix = elems[0] obj = elems[1] filt = elems[2].split(".")[0] ### gets rid of the trailing .txt print "\nCopying files for",obj, filt,"\n" objDir = ao.koiDir(obj,instr="ARIES") objFilterDir = ao.koiFilterDir(obj,filt,instr="ARIES") savedDir = objFilterDir+"saved/" print "Making archive directories if they don't already exist" if os.path.exists(objDir) == False: os.mkdir(objDir) if os.path.exists(objFilterDir) == False: os.mkdir(objFilterDir) if os.path.exists(savedDir) == False: os.mkdir(savedDir) ## The shiftlist, object list, and final image are saved in the main folder print "Copying shiftfile" os.system("cp Shiftlist_"+obj+"_"+filt+".txt "+objFilterDir) print "Copying list of frames" os.system("cp "+ff+" "+objFilterDir+ff)