openmysql,dblun,'des' extra = ' and image like '+quote('030330%') ;extra = '' cmd='select image,ccd,airmass,fwhm,skylevel,skysigma,usnozp,sdsszp '+ $ 'from photcal where catalog='+quote('SDSS')+extra+' order by image,ccd;' mysqlquery,dblun,cmd,image,ccd,airmass,fwhm,skylevel,skysigma,usnozp,sdsszp, $ format='a,i,f,f,f,f,f,f' free_lun,dblun z1=where(ccd eq 1,n1) z2 = replicate(-1,n1) z3 = replicate(-1,n1) z4 = replicate(-1,n1) z5 = replicate(-1,n1) z6 = replicate(-1,n1) z7 = replicate(-1,n1) z8 = replicate(-1,n1) for i=0,n1-1 do begin z=where(image eq image[z1[i]] and ccd eq 2,count) if count eq 1 then z2[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 3,count) if count eq 1 then z3[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 4,count) if count eq 1 then z4[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 5,count) if count eq 1 then z5[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 6,count) if count eq 1 then z6[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 7,count) if count eq 1 then z7[i] = z[0] z=where(image eq image[z1[i]] and ccd eq 8,count) if count eq 1 then z8[i] = z[0] endfor setwin,1,xsize=400,ysize=400 stats,usnozp[z1]-sdsszp[z1],/silent,title='CCD 1, USNOZP-SDSSZP' setwin,2,xsize=400,ysize=400 z=where(z2 ge 0) stats,sdsszp[z2[z]]-sdsszp[z1[z]],/silent,title='CCD 2, ZP2-ZP1' setwin,3,xsize=400,ysize=400 z=where(z3 ge 0) stats,sdsszp[z3[z]]-sdsszp[z1[z]],/silent,title='CCD 3, ZP3-ZP1' setwin,4,xsize=400,ysize=400 z=where(z4 ge 0) stats,sdsszp[z4[z]]-sdsszp[z1[z]],/silent,title='CCD 4, ZP4-ZP1' setwin,5,xsize=400,ysize=400 z=where(z5 ge 0) stats,sdsszp[z5[z]]-sdsszp[z1[z]],/silent,title='CCD 5, ZP5-ZP1' setwin,6,xsize=400,ysize=400 z=where(z6 ge 0) stats,sdsszp[z6[z]]-sdsszp[z1[z]],/silent,title='CCD 6, ZP6-ZP1' setwin,7,xsize=400,ysize=400 z=where(z7 ge 0) stats,sdsszp[z7[z]]-sdsszp[z1[z]],/silent,title='CCD 7, ZP7-ZP1' setwin,8,xsize=400,ysize=400 z=where(z8 ge 0) stats,sdsszp[z8[z]]-sdsszp[z1[z]],/silent,title='CCD 8, ZP8-ZP1' end