Index: trunk/psastro/src/psastroMosaicChipAstrom.c
===================================================================
--- trunk/psastro/src/psastroMosaicChipAstrom.c	(revision 9574)
+++ trunk/psastro/src/psastroMosaicChipAstrom.c	(revision 10830)
@@ -1,5 +1,6 @@
 # include "psastro.h"
+# define NONLIN_TOL 0.001 /* tolerance in pixels */
 
-bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe) {
+bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration) {
 
     pmChip *chip = NULL;
@@ -22,16 +23,12 @@
 		if (! readout->data_exists) { continue; }
 
-		// select the raw objects for this readout
-		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
-		if (rawstars == NULL) { continue; }
+		// save WCS and analysis metadata in update header
+		psMetadata *updates = psMetadataAlloc();
 
-		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
-		if (refstars == NULL) { continue; }
+		psastroMosaicOneChip (chip, readout, recipe, updates, iteration);
 
-		psArray *match = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH");
-		if (match == NULL) { continue; }
-
-		// need to pass in an update header, sent in from above
-		pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, recipe, NULL);
+		pmAstromWriteBilevelChip (updates, chip, NONLIN_TOL);
+		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_DATA_METADATA, "psastro header stats", updates);
+		psFree (updates);
 	    }
 	}
@@ -39,2 +36,5 @@
     return true;
 }
+
+/* the iteration value may be 1 or 2.
+ */
