Index: trunk/Ohana/src/relastro/src/ImageOps.c
===================================================================
--- trunk/Ohana/src/relastro/src/ImageOps.c	(revision 39380)
+++ trunk/Ohana/src/relastro/src/ImageOps.c	(revision 39381)
@@ -766,5 +766,5 @@
       float dTime = (measure[0].t - catalog[c].average[n].Tmean) / (86400*365.25) ; // time relative to Tmean in years
 
-      // XXX do this in a better way?
+      // XXX do this in a better way? (my main concern is that this is wrong near the pole : should be done in a local projection
       ref[i].R += dTime * catalog[c].average[n].uR / 3600.0 / cos(ref[i].D*RAD_DEG);
       ref[i].D += dTime * catalog[c].average[n].uD / 3600.0;
@@ -1129,5 +1129,5 @@
 
 /** Determine whether a measurement should be included in the analysis, based on supplied filter criteria */ 
-// we only optionally apply the sigma limit: for object averages, this should not be used (should it?)
+// we only optionally apply the sigma limit: for object averages, this should not be used
 int MeasFilterTestTiny(MeasureTiny *measure, int applySigmaLim) {
   int found, k;
@@ -1140,4 +1140,9 @@
   if (!finite(measure[0].dM)) return FALSE; //XXX is this necessary for all relastro tasks?
   
+  if ((MinBadQF > 0.0) && (isGPC1chip(measure[0].photcode) || isGPC1stack(measure[0].photcode))) {
+    if (!isfinite(measure[0].psfQF)) { return FALSE; };
+    if (measure[0].psfQF < MinBadQF) { return FALSE; };
+  }
+
   /* select measurements by photcode, or equiv photcode, if specified */
   if (NphotcodesKeep > 0) {
@@ -1159,8 +1164,4 @@
   }  
   
-  // if (MinBadQF > 0.0) {
-  //   if (measure[0].psfQF < MinBadQF) return FALSE;
-  // }
-
   /* select measurements by time */
   if (TimeSelect) {
@@ -1182,4 +1183,6 @@
 
   /* select measurements by measurement error */
+  // this is a bit convoluted: applySigmaLim is only TRUE when this function is
+  // called by bcatalog.  for UpdateObjects, it is FALSE
   if (applySigmaLim && (SIGMA_LIM > 0) && (measure[0].dM > SIGMA_LIM)) {
     return FALSE;
