Index: /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/GetAstromError.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/GetAstromError.c	(revision 33539)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/GetAstromError.c	(revision 33540)
@@ -30,4 +30,8 @@
 
   code 	= GetPhotcodebyCode (measure[0].photcode);
+
+  // do not raise an exception, just send back the result
+  if (isnan(code[0].astromErrSys)) return NAN;
+
   AS   	= code[0].astromErrScale;
   MS   	= code[0].astromErrMagScale;
@@ -68,4 +72,8 @@
 
   code 	= GetPhotcodebyCode (measure[0].photcode);
+
+  // do not raise an exception, just send back the result
+  if (isnan(code[0].astromErrSys)) return NAN;
+
   AS   	= code[0].astromErrScale;
   MS   	= code[0].astromErrMagScale;
Index: /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c	(revision 33539)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c	(revision 33540)
@@ -131,8 +131,8 @@
 	dY[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_DEC);
 
-	// XXX this is a bit hackish -- allow a given photcode or measurement to be
-	// ignored by ignoring excessively bad errors
-	if (dX[N] > 10.0) continue;
-	if (dY[N] > 10.0) continue;
+	// allow a given photcode or measurement to be
+	// ignored if the error is NAN (for photcode, set astromErrSys to NaN)
+	if (isnan(dX[N])) continue;
+	if (isnan(dY[N])) continue;
 
 	// add systematic error in quadrature, if desired
Index: /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c	(revision 33539)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c	(revision 33540)
@@ -287,24 +287,30 @@
 }
 
-// return TRUE if any measure->photcodes match the photcodeSet
+// return TRUE if measure->photcode match any in the photcodeSet
+// (but, return FALSE if the measurement is bad)
 int MeasMatchesPhotcode(Measure *measure, PhotCode **photcodeSet, int Nset) {
 
   int found, k;
 
-  assert (Nset > 0);
-
-  if (!finite(measure[0].dR) || !finite(measure[0].dD)) return FALSE;
-  if (!finite(measure[0].M)) return FALSE;
+  if (!Nset) return TRUE;
+  // XXX require a set or not?  assert (Nset > 0);
+
+  if (!finite(measure[0].dR)) return FALSE;
+  if (!finite(measure[0].dD)) return FALSE;
+  if (!finite(measure[0].M))  return FALSE;
   
+  float dX = GetAstromError (measure, ERROR_MODE_RA);
+  if (isnan(dX)) return FALSE;
+
+  float dY = GetAstromError (measure, ERROR_MODE_DEC);
+  if (isnan(dY)) return FALSE;
+
   /* select measurements by photcode, or equiv photcode, if specified */
-  if (Nset > 0) {
-    found = FALSE;
-    for (k = 0; (k < Nset) && !found; k++) {
-      if (photcodeSet[k][0].code == measure[0].photcode) found = TRUE;
-      if (photcodeSet[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;
-    }
-    if (!found) return FALSE;
-  }
-  
-  return TRUE;
+  found = FALSE;
+  for (k = 0; (k < Nset) && !found; k++) {
+    if (photcodeSet[k][0].code == measure[0].photcode) found = TRUE;
+    if (photcodeSet[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;
+  }
+
+  return found;
 }
