# read the SDSS-I Stripe 82 Variable Source Catalog # read_catalog all varStripe82.dat read_catalog 2 # $1 = subscript for data # $2 = file name da $2 lines 0 0 define L "ra_$1 1 dec_$1 2 rExt_$1 3" define i 4 foreach band { foreach vec { define L <$L $vec""$band""_$1 $i> define i $($i+1) } } read <$L> set uC = <6.27336 -1.60114 0.153714 -0.00656245 0.000105148> set gC = <2.13439 -0.540752 0.0517104 -0.00219396 3.48404e-05> set rC = <2.48331 -0.631346 0.0605023 -0.002575 4.10636e-05> set iC = <3.60719 -0.940377 0.0919942 -0.00398576 6.4533e-05> set zC = <8.06484 -2.16079 0.217055 -0.00967042 0.000161274> ## generate ugiz extinction from r extinction by using coefficients from SFD98 set uExt_$1 = 1.87 * rExt_$1 set gExt_$1 = 1.38 * rExt_$1 set iExt_$1 = 0.76 * rExt_$1 set zExt_$1 = 0.54 * rExt_$1 # reddening correction set u_$1 = medu_$1 - uExt_$1 set g_$1 = medg_$1 - gExt_$1 set r_$1 = medr_$1 - rExt_$1 set i_$1 = medi_$1 - iExt_$1 set z_$1 = medz_$1 - zExt_$1 # and colors set ug_$1 = u_$1 - g_$1 set gr_$1 = g_$1 - r_$1 set ri_$1 = r_$1 - i_$1 set iz_$1 = i_$1 - z_$1 unset uExt_$1 unset gExt_$1 unset iExt_$1 unset zExt_$1 unset fExt_$1 unset nExt_$1 foreach band { set xC = $band""_$1 # mean photometric error fit set yC = $band""C[0]+$band""C[1]*xC+$band""C[2]*xC**2+$band""C[3]*xC**3+$band""C[4]*xC**4 set rmsold$band""_$1 = rms$band""_$1 # intrinsic variability set rms$band""_$1 = (rms$band""_$1**2 >= yC**2)?sqrt(rms$band""_$1**2 - yC**2):-99.99 unset xC unset yC }