Index: trunk/psModules/src/astrom/pmAstrometryObjects.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 40430)
+++ trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 41493)
@@ -285,5 +285,6 @@
     for (int i = 0; i < nIter; i++) {
         if (!psVectorClipFitPolynomial2D (map->x, results->xStats, mask, 0xff, x, wt, X, Y)) {
-            psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for x\n");
+            // psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for x\n");
+            psLogMsg("psModule.astrom", 4, "failure in clip-fitting for x\n");
             psFree (x);
             psFree (y);
@@ -299,5 +300,6 @@
 
         if (!psVectorClipFitPolynomial2D (map->y, results->yStats, mask, 0xff, y, wt, X, Y)) {
-            psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for y\n");
+            // psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for y\n");
+            psLogMsg("psModule.astrom", 4, "failure in clip-fitting for y\n");
             psFree (x);
             psFree (y);
@@ -363,9 +365,15 @@
     }
 
-    results->dXsys = psVectorSystematicError (xResGood, xErr, 0.05);
-    results->dYsys = psVectorSystematicError (yResGood, yErr, 0.05);
-
-    results->dXrange = pmAstromVectorRange (xResGood, 0.1, 0.9, results->xStats->clippedStdev);
-    results->dYrange = pmAstromVectorRange (yResGood, 0.1, 0.9, results->yStats->clippedStdev);
+    // if xResGood or yResGood have no valid data, set these to NAN 
+    if ((xResGood->n == 0) || (yResGood->n == 0)) {
+      results->dXsys   = results->dYsys   = NAN;
+      results->dXrange = results->dYrange = NAN;
+    } else {
+      results->dXsys = psVectorSystematicError (xResGood, xErr, 0.05);
+      results->dYsys = psVectorSystematicError (yResGood, yErr, 0.05);
+
+      results->dXrange = pmAstromVectorRange (xResGood, 0.1, 0.9, results->xStats->clippedStdev);
+      results->dYrange = pmAstromVectorRange (yResGood, 0.1, 0.9, results->yStats->clippedStdev);
+    }
 
     psTrace ("psModules.astrom", 3, "dXsys: %f, dXrange: %f\n", results->dXsys, results->dXrange);
@@ -442,4 +450,5 @@
 
     // Get the minimum and maximum values
+    // XXX either clear the associated error, or disallow in psVectorStats
     if (!psVectorStats(stats, myVector, NULL, NULL, 0)) {
         psFree(stats);
@@ -1042,5 +1051,5 @@
 
     if (minStat->nSigma < minSigma) {
-        psError(PS_ERR_UNKNOWN, true, "Failed to find a valid match (%f sigma for best)", minStat->nSigma);
+	psLogMsg ("psModule.astrom.grid.match", 3, "Failed to find a valid match (%f sigma for best)", minStat->nSigma);
         psFree (minStat);
         return NULL;
