示例#1
0
def makeCompositePlotOfZoomedInImages(koiAndFilterList):
	fig=pylab.figure(0,figsize=(5,10))
	nkoi = len(koiAndFilterList)
	ncols = 1
	if (nkoi % ncols) == 0:
		nrows = nkoi/ncols
	else:
		nrows = nkoi / ncols +1
	print nrows, len(koiAndFilterList)
	
	for ii,kkff in enumerate(koiAndFilterList):
		koi = kkff[0]
		filt = kkff[1]
		myKoi = koiPlusFilter.koiPlusFilter(koi,filt)
		print ii, koi, filt
		if os.path.isfile(ao.koiFilterDir(koi,filt,instrUsed)+ao.finalKOIimageFile(koi,filt,instrUsed)):
#			pylab.subplot(nrows,ncols,ii+1)
			finderPlots.zoomedInSubPlot(myKoi,nrows,ncols,ii+1)
					
#			os.system("./finderPlots.py "+koi+" Ks "+str(nrows)+" "+str(ncols)+" "+str(ii+1))
			pylab.title(koi)
	# Finish and export
	pylab.subplots_adjust(wspace=0.1,hspace=0.1)
	binaryOutfile = ao.plotDir+"combined.pdf"
	pylab.savefig(binaryOutfile)
	pylab.close()
示例#2
0
def makeCompositePlotOfZoomedInImages(filt):
	fig=pylab.figure(0,figsize=(12,6))
	nkoi = len(koiForCompositePlot[filt])
	ncols = 6
	if (nkoi % ncols) == 0:
		nrows = nkoi/ncols
	else:
		nrows = nkoi / ncols +1
	print nrows, len(koiForCompositePlot[filt])
	for ii,koi in enumerate(koiForCompositePlot[filt]):
		myKoi = koiPlusFilter.koiPlusFilter(koi,filt,instrUsed)
		print ii, koi, filt
		if os.path.isfile(ao.objectsDir+koi+"/"+filt[0]+"/"+ao.finalKOIimageFile(koi,filt,instrUsed)):
			finderPlots.zoomedInSubPlot(myKoi,nrows,ncols,ii+1)
			pylab.title(koi)
	# Finish and export
	pylab.subplots_adjust(wspace=0.1,hspace=0.1)
	binaryOutfile = ao.plotDir+"allBinaries_"+filt+".pdf"
	pylab.savefig(binaryOutfile)
	pylab.close()
示例#3
0
def makeOmniPlot(koiList,name,npix,useHardCodedFigSize=False, useHalfBox=2.0,ncols=4, scalebarLabel="", noLabels=False, figWidth=12, useFilts=["J","Ks"], useInstr= ["ARIES","PHARO"], plotExt=".pdf", plotContourList=False, extraScalebar=False):
	if (npix % ncols) == 0:
		nrows = npix/ncols
	else:
		nrows = npix / ncols +1
	if ncols > 3:
		fig=pylab.figure(0,figsize=(figWidth,3.5*nrows))
	elif ncols ==3:
		fig=pylab.figure(0,figsize=(figWidth,4.25*nrows))
	elif useHardCodedFigSize != False:
		fig=pylab.figure(0,figsize=(useHardCodedFigSize[0],useHardCodedFigSize[1]))
		
	else:
		fig=pylab.figure(0,figsize=(4,2.5*nrows))
	ii=0
	for koi in koiList:
		if koi == "blank":
			print "leaving blank square"
			ii = ii + 1
		elif koi == "scalebar":
			ax=pylab.subplot(nrows,ncols,ii+1)
			pylab.plot([0,1],[1,1],color="k",linewidth=2.0)
			pylab.text(0.5,1.05, scalebarLabel, color="k", fontsize=18, horizontalalignment='center')
			pylab.xlim(xmin=0,xmax=1)
			pylab.ylim(ymin=0,ymax=1.15)
			pylab.box(on=False)
			ax.set_xticks([])
			ax.set_yticks([])
#			pylab.title(scalebarLabel)
			ii = ii + 1
		else:
			for filt in useFilts:
				for instr in useInstr:
#					print "Looking for object:", ao.koiFilterDir(koi,filt,instr)
					if os.path.isdir(ao.koiFilterDir(koi,filt,instr)):
						print koi, instr, filt, ii
						myKoi = koiPlusFilter.koiPlusFilter(koi,filt,instr)
						if plotContourList == False:
							useContours = False
						else:
							useContours = plotContourList[ii]
						if ii == 0: ## only plot the (optional) scale bar on the first image
							finderPlots.zoomedInSubPlot(myKoi,nrows,ncols,ii+1,useColorMap=colorScheme,plotContours=useContours,plotLowerScalebar=extraScalebar,scalebarLabel=scalebarLabel)
						else:
							finderPlots.zoomedInSubPlot(myKoi,nrows,ncols,ii+1,useColorMap=colorScheme,plotContours=useContours,plotLowerScalebar=False)
						if noLabels == False:
							if (len(useFilts)==1 & (len(useInstr)==1)):
								pylab.title(koi)
							else:
						#		pylab.title(koi+"\n"+instr+" "+filt)
								pylab.title(koi+" "+" "+filt+" ("+scalebarLabel+")")
						ii = ii + 1
							
	# Finish and export
	pylab.subplots_adjust(wspace=0.1,hspace=0.1)
	binaryOutfile = ao.plotDir+"allBinaries_"+name+plotExt
	if plotExt == ".eps":
		pylab.savefig(binaryOutfile, format='eps')
	else:
		pylab.savefig(binaryOutfile)
	pylab.close()