Last modified 6 years ago Last modified on 02/01/2013 12:21:07 AM

For each galaxy in the BRG dataset, return those which have a neighbour closer than ? arcsec with ellipticity > ? and position angle <> ?

This query was suggested by the LSST Science Collaboration (Strong Lensing).

SELECT o.objectId
JOIN   Neighbors n USING (objectId)
JOIN   Object o ON (n.neighborId = o.objectId)
WHERE  n.radius < :distance
  AND  Ellipticity(o.fwhmA, o.fwhmB) > :ellipticity
  AND  o.fwhmTheta BETWEEN :fwhmMin AND :fwhmMax

Assumes that BRG dataset has been associated with LSST Objects. Assumes presence of Neighbors table. Assumes that fwhm columns are present in Object, derived from Source. Assumes availability of Ellipticity function based on major and minor axes.