pro narrow_set2 ; This routine sets the gred and D51 magnitudes of all stars in the ; tstds database to the values that theory prescribes for these filters, ; given the g,r magnitudes for the same stars. zdbase=getenv('ZDBASE') stardbase=zdbase+'/survey/stars/tstds' grparms=[-.2,1.2,-.030,-.589] ; gred g-r valid limits, intercept, slope d5parms=[-.2,1.2,.070,.262] ; d51 g-r valid limits, intercept, slope astrolib !priv=2 sig=0.05 ; nominal error for Gred and D51 for single star ; get g and r magnitudes from standards database dbopen,stardbase,1 dbext,-1,'g,sig_g,r,sig_r',gall,sgall,rall,srall nst=n_elements(gall) gredall=fltarr(nst)+99.9 sgredall=fltarr(nst)+99.9 d51all=fltarr(nst)+99.9 sd51all=fltarr(nst)+99.9 s=where(gall gt 0. and gall lt 40. and rall gt 0. and rall lt 40.,ns) if(ns gt 0) then begin gmr=gall(s)-rall(s) gr=-grparms(2)+gall(s)*(1.-grparms(3))+grparms(3)*rall(s) d5=-d5parms(2)+gall(s)*(1.-d5parms(3))+d5parms(3)*rall(s) gredall(s)=gr d51all(s)=d5 sgredall(s)=sig sd51all(s)=sig endif dbupdate,[-1],'gred,sig_gred,d51,sig_d51',gredall,sgredall,d51all,sd51all dbclose end