Last modified 6 years ago Last modified on 01/31/2013 11:21:25 PM

Find all galaxies without saturated pixels within certain distance of a given point

declare @saturated bigint;                              -- initialize "saturated" flag
set     @saturated = dbo.fPhotoFlags('saturated');      -- avoid SQL2K optimizer problem

select  G.objectId, GN.distance                         -- return Galaxy Object ID and angular distance (arc min)
from    Galaxy                      as G                -- join Galaxies with
join    fGetNearbyObjEq(195,2.5, 1) as GN USING (objectId)  -- objects within ' of ra=195 & dec=2.5
where (G.flags & @saturated) = 0                        -- not saturated
order by distance                                       -- sorted nearest first

Todo: understand how to rework flags and functions, don't have them in LSST schema

fGetNearbyObjEq is described here:

fPhotoFlags is described here:

This query originally came from SDSS (S-1)