wiki:db/queries/013
Last modified 6 years ago Last modified on 01/31/2013 11:16:54 PM

Find all objects within ? arcseconds of one another that have very similar colors

"Similar colors" mean that the color ratios u-g, g-r, r-i ... are small, eg. < 0.05

SELECT DISTINCT o1.objectId, o2.objectId
FROM   Object o1, 
       Object o2
WHERE  spDist(o1.ra, o1.decl, o2.ra, o2.decl) < 0.1
  AND  o1.objectId <> o2.objectId
  AND  ABS( (o1.fluxToAbMag(uFlux_PS)-o1.fluxToAbMag(gFlux_PS)) - 
            (o2.fluxToAbMag(uFlux_PS)-o2.fluxToAbMag(gFlux_PS)) ) < :colorCut1
  AND  ABS( (o1.fluxToAbMag(gFlux_PS)-o1.fluxToAbMag(rFlux_PS)) - 
            (o2.fluxToAbMag(gFlux_PS)-o2.fluxToAbMag(rFlux_PS)) ) < :colorCut2
  AND  ABS( (o1.fluxToAbMag(rFlux_PS)-o1.fluxToAbMag(iFlux_PS)) - 
            (o2.fluxToAbMag(rFlux_PS)-o2.fluxToAbMag(iFlux_PS)) ) < :colorCut3
  AND  ABS( (o1.fluxToAbMag(iFlux_PS)-o1.fluxToAbMag(zFlux_PS)) - 
            (o2.fluxToAbMag(iFlux_PS)-o2.fluxToAbMag(zFlux_PS)) ) < :colorCut4

Origin: SDSS (S-18)