pro kic_qc3,tlist,diffo,rao,deco,ps=ps,iout=iout ; this routine opens the a tilelist as does kic_qc1, and for each tile selects ; 'good' stars and plots the difference between the reddened model colors ; for these stars and the observed ones. color-color plots are done for ; i-z vs g-r, z-J vs g-r, g-D51 vs g-r ; J-K vs g-i J-H vs g-i ; Results are written to kic_qc3.ps, if keyword ps is set. ; If keyword iout is set, its value minus 1 is the tile index for which ; the difference obsd-theory mags will be returned in array diffo. ; constants zdbase=getenv('ZDBASE') starpath=zdbase+'/survey/stars/' proppath=zdbase+'/survey/properties/' ;tiles=['t132+012','t296+035','t300+040','t285+040','t291+041'] ;nt=n_elements(tiles) colorblock='/home/tbrown/d/basel/colblock_cas4_smth.sav' ;xformi='/home/tbrown/d/basel/xform_color_cas3.sav' xformi='/home/tbrown/d/basel/xform_color_cas4.sav' 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 if(keyword_set(ps)) then psflag=1 else psflag=0 ; 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,'g,r,i,z,j,h,k,d51',gg,rr,ii,zz,jj,hh,kk,d5 dbext,-1,'ra,dec',ra,dec dbclose dbopen,proppath+tiles(i) dbext,-1,'teff,logg,err_logg,logz,ext,',teff,logg,elogg,logz,ext dbclose ; choose good stars to plot sg=where(rr lt 17 and gg lt 40 and ii lt 40 and zz 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) 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) ; make model colors, given the other properties colors_blk_intrp,colblock,teffu,loggu,logzu,teff,logg,logz,colsout,$ xform=xform ; correct these for expected reddening red_vector,ext,dcolor,xform=xform colsout=colsout+dcolor ; make differences between models and obsd colors diff=colobs-colsout ; copy to diffo array if keyword iout is set if(psflag eq 1) then begin if(i eq iout-1) then begin diffo=diff rao=ra deco=dec endif endif ;stop ; plot them if(psflag eq 1) then begin ps,name=plotdir+'/'+tiles(i)+'_qc3.ps' !p.multi=[0,1,2] lps=1 endif else begin lps=0 endelse xr=[-.25,.25] yr=[-.25,.25] plot,diff(1,*),diff(2,*),psym=3,xtit='g-r Err',ytit='r-i Err',$ tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 ;stop plot,diff(1,*),diff(8,*),psym=3,xtit='g-r Err',ytit='g-D51 Err',$ tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 plot,diff(2,*),diff(3,*),psym=3,xtit='r-i Err',ytit='i-z Err',$ tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 plot,diff(3,*),diff(4,*),psym=3,xtit='i-z Err',ytit='z-J Err',$ tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 plot,diff(1,*)+diff(2,*),diff(5,*)+diff(6,*),psym=3,$ xtit='g-i Err',ytit='J-K Err',tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=3.*yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 plot,diff(5,*),diff(6,*),psym=3,$ xtit='J-H Err',ytit='H-K Err',tit=tiles(i)+' b = '+sgb,$ charsiz=1.5,xran=xr,yran=3.*yr oplot,[-1,1],[0.,0.] oplot,[0.,0.],[-1.,1.] if(lps eq 0) then cursor,x,y,3 endif if(lps gt 0 and nsg gt 0) then begin psend sun !p.multi=[0,1,1] endif ;stop endfor end