Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38320)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38321)
@@ -400,14 +400,14 @@
     end
 
-    mextract ra dec dbflags
-    subset rs = ra  if (dbflags & 0x8000)
-    subset ds = dec if (dbflags & 0x8000)
+    mextract ra dec mag dbflags
+    subset rs = ra  if ((dbflags & 0x8000) && (mag > 13.5))
+    subset ds = dec if ((dbflags & 0x8000) && (mag > 13.5))
     avmatch rs ds 0.1 $FILTER\:flags $FILTER\:uc_dist 
 
-    subset tmp = rs if ($FILTER\:flags & 0x8)
-    tapOK {tmp[] == rs[]} "objects with ubercal detections have ubercal bit set (tmp[] vs rs[])"
+    subset tmp = rs if (($FILTER\:flags & 0x8) || ($FILTER\:flags & 0x4))
+    tapOK {tmp[] == rs[]} "objects with ubercal detections have ubercal bit set or used SYNTH photometry (tmp[] vs rs[])"
  
-    subset tmp = rs if ($FILTER\:uc_dist < 0.1)
-    tapOK {tmp[] == rs[]} "objects with ubercal detections have ubercal dist of 0.0"
+    subset tmp = rs if (($FILTER\:uc_dist < 0.1) || ($FILTER\:flags & 0x4))
+    tapOK {tmp[] == rs[]} "objects with ubercal detections have ubercal dist of 0.0 or used SYNTH photometry"
     return
   end
