Index: /branches/eam_branches/ipp-20140423/psastro/src/psastro.h
===================================================================
--- /branches/eam_branches/ipp-20140423/psastro/src/psastro.h	(revision 36736)
+++ /branches/eam_branches/ipp-20140423/psastro/src/psastro.h	(revision 36737)
@@ -90,4 +90,6 @@
 psArray          *psastroRemoveClumpsIterate (psArray *input, int scale, int nIter);
 bool              psastroRemoveClumpsRawstars (pmConfig *config);
+
+bool              psastroChipFailureHeader (psMetadata *updates);
 
 
Index: /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipFit.c
===================================================================
--- /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipFit.c	(revision 36736)
+++ /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipFit.c	(revision 36737)
@@ -62,4 +62,5 @@
         if (match == NULL) {
             psLogMsg ("psastro", 3, "failed to find radius-matched sources\n");
+	    psastroChipFailureHeader (updates);
             return false;
         }
@@ -69,4 +70,5 @@
 	    if (!unique) {
 		psLogMsg ("psastro", 3, "failed to generate a uniq set of matched sources\n");
+		psastroChipFailureHeader (updates);
 		return false;
 	    }
@@ -99,4 +101,5 @@
             psLogMsg ("psastro", 3, "insufficient stars or invalid order: %ld stars", match->n);
             psFree (match);
+	    psastroChipFailureHeader (updates);
             return false;
         }
@@ -126,4 +129,5 @@
             psFree (match);
             psFree (fitStats);
+	    psastroChipFailureHeader (updates);
             return false;
         }
@@ -185,6 +189,5 @@
         psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", astNstar);
     } else {
-        psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", 0.0);
-        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", 0);
+	psastroChipFailureHeader (updates);
     }
     psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "equinox of ref catalog", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
@@ -222,4 +225,12 @@
 }
 
+bool psastroChipFailureHeader (psMetadata *updates) {
+    psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", 0.0);
+    psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", 0);
+    return true;
+}
+
+
+
 // psastroWriteStars ("raw.1.dat", rawstars);
 // psastroWriteStars ("ref.1.dat", refstars);
Index: /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipGrid.c
===================================================================
--- /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipGrid.c	(revision 36736)
+++ /branches/eam_branches/ipp-20140423/psastro/src/psastroOneChipGrid.c	(revision 36737)
@@ -57,4 +57,5 @@
 	psFree (rawGridStars);
 	psFree (refGridStars);
+	psastroChipFailureHeader (updates);
 	return false;
     }
@@ -68,4 +69,5 @@
 	psFree (rawGridStars);
 	psFree (refGridStars);
+	psastroChipFailureHeader (updates);
 	return false;
     }
