wiki:db/queries/068
Last modified 6 years ago Last modified on 02/01/2013 12:37:03 AM

Matching Source Catalog with the SimRefObjectCatalog? through precomputed Match table

SELECT sce.visit, sce.raftName, sce.ccdName, 
       sro.rMag, sro.ra, sro.decl, sro.isStar, sro.refObjectId,  
       rom.nSrcMatches,
       s.sourceId,s.ra, s.decl, s.xAstrom, s.yAstrom, s.psfFlux,
       s.psfFluxSigma, s.apFlux, s.apFluxSigma, s.flux_ESG,
       s.flux_Gaussian, s.ixx, s.iyy, s.ixy, s.psfIxx, s.psfIxxSigma,
       s.psfIyy, s.psfIyySigma, s.psfIxy, s.psfIxySigma, 
       s.resolution_SG, s.e1_SG, s.e1_SG_Sigma, s.e2_SG, s.e2_SG_Sigma,
       s.shear1_SG, s.shear1_SG_Sigma, s.shear2_SG, s.shear2_SG_Sigma,
       s.sourceWidth_SG,s.sourceWidth_SG_Sigma,s.flagForDetection  
FROM   Source AS s, 
       Science_Ccd_Exposure AS sce,    
       RefSrcMatch AS rom, 
       SimRefObject AS sro  
WHERE (s.scienceCcdExposureId = sce.scienceCcdExposureId)
  AND (s.sourceId = rom.sourceId)
  AND (rom.refObjectId = sro.refObjectId)
  AND (sce.visit = 925692311)
  AND (sce.raftName = '3,0') and (sce.ccdName = '0,2')

This query is for a single visit, raft and ccd, but we can easily imagine a similar full-sky query...

Frequently run by PipeQA.