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']) ### Read in .mag file apertures, numStars, xySkyDict, starDict = ao.readPhotMagFile(fitsDir,fitsFile,magSuffix=".mag")
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)
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
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 ### Get object 2MASS magnitudes if obj in objects2MASS: print obj + " is in our 2MASS table with Ks mag:",magDict[obj,"Ks"] jMag = catalogs.getObjMag2MASS(obj,"J") hMag = catalogs.getObjMag2MASS(obj,"H") kMag = catalogs.getObjMag2MASS(obj,"Ks")
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