Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SELECT d.ID_GAIA,d.RA_GAIA as GAIARA, d.DEC_GAIA as GAIADec, d.Gmag, d.period,
o.objID, o.raMean, o.decMean, o.raMeanErr, o.decMeanErr, o.qualityFlag, o.gMeanPSFMag, o.gMeanPSFMagErr, o.gMeanPSFMagNpt, o.rMeanPSFMag, o.rMeanPSFMagErr, o.rMeanPSFMagNpt, o.iMeanPSFMag, o.iMeanPSFMagErr, o.iMeanPSFMagNpt, o.zMeanPSFMag, o.zMeanPSFMagErr, o.zMeanPSFMagNpt, o.yMeanPSFMag, o.yMeanPSFMagErr, o.yMeanPSFMagNpt, o.rMeanKronMag, o.rMeanKronMagErr, o.nDetections, o.ng, o.nr, o.ni, o.nz,o.ny, o.gFlags, o.gQfPerfect, o.rFlags, o.rQfPerfect, o.iFlags, o.iQfPerfect, o.zFlags, o.zQfPerfect, o.yFlags, o.yQfPerfect, soa.primaryDetection, soa.bestDetection  INTO mydb.[RRL_584630948352256_PS1] FROM mydb.[rrl_584630948352256] d
CROSS APPLY dbo.fGetNearbyObjEq(d.RA_GAIA, d.DEC_GAIA, 1.0/360060.0) as x
JOIN MeanObjectView o on o.ObjID=x.ObjId
LEFT JOIN StackObjectAttributes AS soa ON soa.objID = x.objID
WHERE o.nDetections>8 
AND soa.primaryDetection>0 
AND o.gQfPerfect>0.85 and o.rQfPerfect>0.85 and o.iQfPerfect>0.85 and o.zQfPerfect>0.85 
AND (o.rmeanpsfmag - o.rmeankronmag < 0.05)

...