pro kic_qc1,tlist,prnt=prnt ; this routine opens tiles in the Kepler field named in tlist, and for each tile selects ; 'good' stars and plots color-color diagrams with plot symbols that ; distinguish between giants and dwarfs. ; Colors are dereddened before plotting. ; Color-color plots are done for ; g-D51 vs g-r, and J-K vs g-i ; Results are written to kic_qc1.ps ; Also plotted for each tile are teff vs logg and a histogram of logz. ; Stats on convergence and on giant/dwarf separation are written to kic_qc1_log.asc ; If keyword prnt is set, star parameters are written to an ascii file ; whose name is given by the prnt keyword. ; Written out are RA, Dec, r, {g-r, g-i, g-d51, J-K}_obsd, ; {g-r,g-i,g-d51,J-K}_unreddened, ; teff,logg,logz,ext ; constants zdbase=getenv('ZDBASE') starpath=zdbase+'/survey/stars/' proppath=zdbase+'/survey/properties/' ;tiles=['t132+012','t296+035','t300+040','t285+040','t291+041'] colorblock='/home/tbrown/d/basel/colblock_cas4_smth.sav' xformi='/home/tbrown/d/basel/xform_color_cas4.sav' logfile='kic_qc1_log.asc' plotdir='kic_qc_plots' common tables,logln,logtn,hrb,$ logtp,loggp,bcp,bmvp,loglump,logmassp,rabsp,vabsp,vmrp,$ teffu,loggu,logzu,colblock restore,colorblock xform=xformi openw,iunl,logfile,/get_lun if(keyword_set(prnt)) then openw,iuno,prnt,/get_lun ; get the tilenames openr,iun,tlist,/get_lun ss='' tiles=[''] while(not eof(iun)) do begin readf,iun,ss tiles=[tiles,strtrim(ss,2)] endwhile close,iun free_lun,iun tiles=tiles(1:*) nt=n_elements(tiles) ; loop over tiles for i=0,nt-1 do begin dbopen,starpath+tiles(i) dbext,-1,'ra,dec,g,r,i,z,j,h,k,d51',ra,dec,gg,rr,ii,zz,jj,hh,kk,d5 dbclose dbopen,proppath+tiles(i) dbext,-1,'teff,logg,err_logg,logz,ext,kepmag,radius',$ teff,logg,elogg,logz,ext,kmag,radius dbclose nst=n_elements(ra) ; choose good stars to plot ; converged fits sc=where(elogg lt 8 and logg lt 8,nsc) ; r mag <= 17, g,i,d51,J all valid sp=where(rr lt 17 and gg lt 40 and ii lt 40 and d5 lt 40 and $ jj lt 40,nsp) ; r mag <= 17, g,i,d51,J all valid, properties fit converged. sg=where(rr lt 17 and gg lt 40 and ii lt 40 and d5 lt 40 and $ jj lt 40 and logg lt 8 and elogg lt 8,nsg) if(nsg gt 0) then begin ra=ra(sg) dec=dec(sg) rro=rr(sg) gmr=gg(sg)-rr(sg) rmi=rr(sg)-ii(sg) imz=ii(sg)-zz(sg) zmj=zz(sg)-jj(sg) jmh=jj(sg)-hh(sg) hmk=hh(sg)-kk(sg) gmd5=gg(sg)-d5(sg) umg=fltarr(nsg) gmgr=fltarr(nsg) colobs=[umg,gmr,rmi,imz,zmj,jmh,hmk,gmgr,gmd5] colobs=transpose(reform(colobs,nsg,9)) ; estimate central RA, Dec, compute galactic latitude ram=median(ra)*15. decm=median(dec) glactc,ram,decm,2000.0,gl,gb,1,/degree sgb=string(gb,format='(f6.2)') ; make model parameters teff=teff(sg) logg=logg(sg) logz=logz(sg) ext=ext(sg) kmag=kmag(sg) radius=radius(sg) sgi=where(logg lt 3.8,nsgi) sdw=where(logg ge 3.8,nsdw) ; dump convergence, giant/dwarf info to log file printf,iunl,tiles(i),' b = ',sgb printf,iunl printf,iunl,'total stars ',nst,format='(a20,i6)' printf,iunl,'good photometry ',nsp,format='(a20,i6)' printf,iunl,'converged fits ',nsc,format='(a20,i6)' printf,iunl,'raw frac converged ',float(nsc)/nst,format='(a20,12x,f5.3)' printf,iunl,'good frac converged',float(nsg)/nsp,format='(a20,12x,f5.3)' printf,iunl dfrac=float(nsdw)/nsg gfrac=float(nsgi)/nsg printf,iunl,'ndwarf, dwarf frac ',nsdw,dfrac,format='(a20,i6,6x,f5.3)' printf,iunl,'ngiant, giant frac ',nsgi,gfrac,format='(a20,i6,6x,f5.3)' printf,iunl printf,iunl ; correct the observed colors for derived reddening red_vector,ext,dcolor,xform=xform colsout=colobs-dcolor ; make log mass logmass=logg-4.378+2.*alog10(radius > 0.001) ; plot them ps,name=plotdir+'/'+tiles(i)+'_qc1.ps' !p.multi=[0,1,2] xr=[0.,1.8] yr=[0.,.5] plot,colsout(1,*),colsout(8,*),psym=3,$ xtit='Dereddened g-r',ytit='Dereddened g-D51',tit=tiles(i) + ' Giants' + $ ' b = '+sgb,charsiz=1.5,xran=xr,yran=yr,/xsty,/ysty if(nsgi gt 0) then oplot,colsout(1,sgi),colsout(8,sgi),psym=4,symsiz=0.3 plot,colsout(1,*),colsout(8,*),psym=3,$ xtit='Dereddened g-r',ytit='Dereddened g-D51',tit=tiles(i) + ' Dwarfs' + $ ' b = '+sgb,charsiz=1.5,xran=xr,yran=yr,/xsty,/ysty if(nsdw gt 0) then oplot,colsout(1,sdw),colsout(8,sdw),psym=4,symsiz=0.3 xr=[0,3.5] yr=[0,1.5] plot,colsout(1,*)+colsout(2,*),colsout(5,*)+colsout(6,*),psym=3,$ xtit='Dereddened g-i',ytit='Dereddened J-K',tit=tiles(i) + $ ' Giants'+' b = '+sgb,charsiz=1.5,xran=xr,yran=yr,/xsty,/ysty if(nsgi gt 0) then oplot,colsout(1,sgi)+colsout(2,sgi),colsout(5,sgi)+colsout(6,sgi),$ psym=4,symsiz=0.3 plot,colsout(1,*)+colsout(2,*),colsout(5,*)+colsout(6,*),psym=3,$ xtit='Dereddened g-i',ytit='Dereddened J-K',tit=tiles(i) + $ ' Dwarfs'+' b = '+sgb,charsiz=1.5,xran=xr,yran=yr,/xsty,/ysty if(nsdw gt 0) then oplot,colsout(1,sdw)+colsout(2,sdw),colsout(5,sdw)+colsout(6,sdw),$ psym=4,symsiz=0.3 ; HR diag and extinction plots xr=[12000.,3000.] yr=[5.5,0.] xtv=[12000.,10000.,9000.,8000.,7000.,6000.,5000.,4000.,3000.] xtn=['12','10','9','8','7','6','5','4','3'] plot,teff,logg,psym=3,xtit='Teff (1000K)',ytit='log(g)',xran=xr,yran=yr,/xsty,/ysty,$ tit='Teff/log(g) '+tiles(i)+' b = '+sgb,charsiz=1.5,/xtyp,xtickv=xtv,$ xtickname=xtn,xticks=8 xr=[10.,20.] plot,gg(sg),ext,psym=3,xtit='g Magnitude',ytit='A_V Extinction',xran=xr,$ tit='Extinction '+tiles(i)+' b = '+sgb,charsiz=1.5,/xsty ; g-r vs teff, histogram of logz xr=[19000.,2500.] yr=[-1.,2.] xtv=[20000.,16000.,12000.,10000.,9000.,8000.,7000.,6000.,5000.,4000.,3000.] xtn=['20','16','12','10','9','8','7','6','5','4','3'] plot,teff, gmr,psym=3,xran=xr,yran=yr,xtit='Teff (1000K)',ytit='Observed g-r',$ charsiz=1.5,$ tit='g-r vs Teff '+tiles(i)+' b = '+sgb,/xsty,/ysty,/xtyp,xtickv=xtv,$ xtickname=xtn,xticks=10 xr=[-2.5,1.] hg=histogram(logz,min=-2.5,binsiz=0.1) xx=-2.5+0.1*findgen(36) plot,xx,hg,xran=xr,xtit='log(Z)',ytit='# of Stars',charsiz=1.5,/xsty,$ tit='log(Z) '+tiles(i)+' b = '+sgb ; log radius vs log mass, dec vs ra xr=[-.5,1.] yr=[-.5,3.] xtit='log(Mass)' ytit='log(Radius) tit='R vs M '+tiles(i)+' b= '+sgb plot,logmass,alog10(radius > .01),psym=3,xtit=xtit,ytit=ytit,tit=tit,$ charsiz=1.5,xran=xr,yran=yr,/xsty,/ysty dra=ra*15. sbr=where(kmag le 16.,nsbr) xr=[min(floor(dra)),max(ceil(dra))] yr=[min(floor(dec)),max(ceil(dec))] xtit='RA (degree)' ytit='Dec (degree)' tit='RA,Dec, Kepmag<16 '+tiles(i)+' b= '+sgb if(nsbr gt 0) then plot,dra(sbr),dec(sbr),psym=3,xtit=xtit,ytit=ytit,tit=tit,xran=xr,yran=yr,$ charsiz=1.5,/xsty,/ysty if(keyword_set(prnt)) then begin printf,iuno,tiles(i) printf,iuno,' RA Dec r g-r_o g-i_o g-d5_o J-K_o'+$ ' g-r_d g-i_d g-d5_d J-K_d Teff log(g) log(Z) A_V' f5='(2(f10.4),f8.3,8f8.3,f7.0,1x,3f8.3)' for ji=0,nsg-1 do begin printf,iuno,ra(ji)*15.,dec(ji),rro(ji),$ colobs(1,ji),colobs(1,ji)+colobs(2,ji),colobs(8,ji),$ colobs(5,ji)+colobs(6,ji),$ colsout(1,ji),colsout(1,ji)+colsout(2,ji),colsout(8,ji),$ colsout(5,ji)+colsout(6,ji),$ teff(ji),logg(ji),logz(ji),ext(ji),format=f5 endfor endif endif psend endfor sun !p.multi=[0,1,1] close,iunl free_lun,iunl if(keyword_set(prnt)) then begin close,iuno free_lun,iuno endif end