Index: trunk/ppTranslate/src/ppMopsRead.c
===================================================================
--- trunk/ppTranslate/src/ppMopsRead.c	(revision 38729)
+++ trunk/ppTranslate/src/ppMopsRead.c	(revision 40038)
@@ -229,4 +229,5 @@
     psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE");
     psVector *flagsV = psMetadataLookupVector(NULL, table, "FLAGS");
+    psVector *flags2V = psMetadataLookupVector(NULL, table, "FLAGS2");
     psVector *xExtErrV = NULL;
     psVector *yExtErrV = NULL;
@@ -240,4 +241,11 @@
     }
 
+    //MEH -- diff params, may need skyChipPsfVersion 
+    psVector *npos = psMetadataLookupVector(NULL, table, "DIFF_NPOS");
+    psVector *fpos = psMetadataLookupVector(NULL, table, "DIFF_FRATIO");
+    psVector *rbad = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_BAD");
+    psVector *rmask = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_MASK");
+    psVector *rall = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_ALL");
+
     double plateScale = 0.0;        // Plate scale
     long numGood = 0;               // Number of good rows
@@ -250,4 +258,37 @@
         continue;
       }
+
+      //MEH -- section off flags2 and diffstats cuts to just be for WSdiffs -- 
+      // -- need to test similarity/differences for WW/WS -- have separate block for WW
+      // -- may need to move block
+      if (!strcasecmp(args->difftype, "WS")) {
+        psU64 flags2 = flags2V->data.U64[row]; // table reads in as U64 
+        if (flags2 & SOURCE_MASK2) {
+          psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of flags2: %lud", row, i, flags2);
+          det->mask->data.U8[row] = 0xFF;
+          continue;
+        }
+
+        // add diff params to discard -- needs to be in config.. -- WSdiff only?
+        // -- needs to be finite to test but unclear if should reject (probably)
+        // -- using Napoli 2013 to start with
+        // DIFF_NPOS>3
+        // DIFF_FRATIO>0.6
+        // DIFF_NRATIO_BAD>0.4
+        // DIFF_NRATIO_MASK>0.4
+        // DIFF_NRATIO_ALL>0.3
+        // -- unclear about npos still -- 
+        //if (npos->data.F32[row]<=3 ||
+        if (!isfinite(fpos->data.F32[row]) || !isfinite(rbad->data.F32[row]) || !isfinite(rmask->data.F32[row]) || !isfinite(rall->data.F32[row])) {
+           psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of NAN diff params: 3, 0.6, 0.4, 0.4, 0.3: %ld %g %f %f %f ", row, i, npos->data.F32[row],fpos->data.F32[row],rbad->data.F32[row],rmask->data.F32[row],rall->data.F32[row]);
+          det->mask->data.U8[row] = 0xFF;
+          continue;
+        }
+        if (fpos->data.F32[row]<=0.6 || rbad->data.F32[row]<=0.4 || rmask->data.F32[row]<=0.4 || rall->data.F32[row]<=0.3) {
+          psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of diff params: 3, 0.6, 0.4, 0.4, 0.3: %ld %g %f %f %f ", row, i, npos->data.F32[row],fpos->data.F32[row],rbad->data.F32[row],rmask->data.F32[row],rall->data.F32[row]);
+	  det->mask->data.U8[row] = 0xFF;
+	  continue;
+        }
+      } 
 
       // Calculate error in RA, Dec
