else: print "The file does not exist. Running all objects..." objectDirListing=os.listdir(objectDataDir) useObjects = [] for obj in objectDirListing: useObjects.append(obj) print "Using:",useObjects filters = ao.filterNames print "Searching for filters:",filters ## Import settings files settings={} for obj in useObjects: settings[obj]={} settings[obj]=ao.readSettingsFile(ao.settingsFile(obj)) ################### END PREAMBLE ############################ createIndividualPlots = False #### Create finder charts for each individual object if createIndividualPlots: for filt in filters: for obj in useObjects: fitsFile=ao.koiFilterDir(obj,filt,instrUsed) + ao.finalKOIimageFile(obj,filt,instrUsed) if os.path.isfile(fitsFile): ## Could also call finderPlots directly os.system("./finderPlots.py "+obj+" "+filt+ " "+instrUsed)
### if keyword == "Raw_data_dir": ### useValue = ao.dataDir+settingsDict["Night"]+"/" # Notify user if there are missing, required entries if useValue == "XX": print "Need value for: ",obj,keyword return useValue ##### Read in 2MASS magDict=catalogs.all2MASS() objects2MASS = catalogs.get2MASSobjects() for obj in useObjects: settingsFile = ao.settingsFile(obj,instrUsed) ## By default set the oldSettings to not exist (so things work when you add new keywords) oldSettings={} ## Read in existing file if it exists if (rerun == False) & (os.path.isfile(settingsFile) == True): oldSettings = ao.readSettingsFile(settingsFile) print "Reusing prior settings for "+obj for key in allKeys: if key not in oldSettings.keys(): oldSettings[key]="XX" else: for key in allKeys: oldSettings[key]="XX" print "Recreating settings file from scratch for "+obj
entry = raw_input("Example: K12345 ") useObjects = entry.split(" ") else: useObjects = allObjects print "Using objects:",useObjects,"\n" g = open("usingObjects.txt","w") for obj in useObjects: print >>g,obj g.close() ################################## Create settings file ############################## for obj in useObjects: if os.path.isfile(ao.settingsFile(obj,instrUsed)) == False: os.system("./createSettings.py "+obj+" "+instrUsed) else: print obj, "using existing settings file" ################################## Now display them all ############################## print "Should we display of the final images in one glorious DS9 window per filter?" entry = raw_input("y or Y to agree, anything else no: ") if ((entry == "Y") | (entry == "y")): for filt in filters: command = "ds9 -zscale -zoom 0.5" for obj in useObjects: if os.path.isfile(objectDataDir+obj+"/"+filt[0]+"/"+obj + "_"+filt+".fits"): command = command +" " + objectDataDir+obj+"/"+filt[0]+"/"+obj + "_"+filt+".fits" command = command +" -single &" if command != "ds9 -zscale -zoom 0.5 -single &":
else: print "The file does not exist. Running all objects..." objectDirListing=os.listdir(objectDataDir) useObjects = [] for obj in objectDirListing: useObjects.append(obj) print "Using:",useObjects filters = ao.filterNames print "Searching for filters:",filters ## Import settings files settings={} for obj in useObjects: settings[obj]={} settings[obj]=ao.readSettingsFile(ao.settingsFile(obj,instrUsed)) ################### END PREAMBLE ############################ for obj in useObjects: for filt in filters: image = ao.koiFilterDir(obj,filt,instrUsed)+ao.finalKOIimageFile(obj,filt) # print "Does image exist?",image if os.path.isfile(image): #if os.path.isfile(ao.limMagFile(obj,filt,instrUsed)): # print "Limit file exists:",ao.limMagFile(obj,filt,instrUsed) #else: os.system("./magLimits.py "+obj+" "+filt+" "+instrUsed) # print("Why aren't I running ./magLimits.py "+obj+" "+filt+" "+instrUsed) else: print "No such file:", obj, filt
else: print "The file does not exist. Running all objects..." objectDirListing=os.listdir(ao.objectsDir) useObjects = [] for obj in objectDirListing: useObjects.append(obj) print "Using:",useObjects filters = ao.filterNames print "Searching for filters:",filters ## Import settings files settings={} for obj in useObjects: settings[obj]={} settings[obj]=ao.readSettingsFile(ao.settingsFile(obj)) ################### END PREAMBLE ############################ ### Other settings copyDataFiles=True makeObservingSummary=True closeDist = 10.0 # arcsec ### Format of file name is determined by ### https://kfop.ipac.caltech.edu/files/website/Bulk_File_Upload_Instructions_v3.pdf date = string.replace(str(datetime.datetime.now())[:10],"-","") ####################### CHECK THIS! ############################# ## You must use a new number every time you try (and fail) to upload per day