Index: /trunk/psastro/src/Makefile.am
===================================================================
--- /trunk/psastro/src/Makefile.am	(revision 19048)
+++ /trunk/psastro/src/Makefile.am	(revision 19049)
@@ -67,4 +67,5 @@
 	psastroMosaicSetAstrom.c    \
 	psastroMosaicSetMatch.c     \
+	psastroZeroPoint.c    	    \
 	psastroDemoDump.c           \
 	psastroDemoPlot.c
Index: /trunk/psastro/src/psastro.h
===================================================================
--- /trunk/psastro/src/psastro.h	(revision 19048)
+++ /trunk/psastro/src/psastro.h	(revision 19049)
@@ -97,3 +97,6 @@
 bool              psastroMetadataStats (pmConfig *config);
 
+bool psastroZeroPointReadout(psArray *rawstars, psArray *refstars, psArray *matches);
+bool psastroZeroPoint (pmConfig *config);
+
 # endif /* PSASTRO_H */
Index: /trunk/psastro/src/psastroAnalysis.c
===================================================================
--- /trunk/psastro/src/psastroAnalysis.c	(revision 19048)
+++ /trunk/psastro/src/psastroAnalysis.c	(revision 19049)
@@ -79,5 +79,5 @@
     }
 
-    // psastroZeroPoint (rawstars, refstars, matches);
+    // psastroZeroPoint (config);
 
     // XXX how do we specify stack astrometry?
Index: /trunk/psastro/src/psastroZeroPoint.c
===================================================================
--- /trunk/psastro/src/psastroZeroPoint.c	(revision 19048)
+++ /trunk/psastro/src/psastroZeroPoint.c	(revision 19049)
@@ -1,13 +1,11 @@
 # include "psastroInternal.h"
 
-bool GetZeroPoint(psArray *rawstars, psArray *refstars, psArray *matches);
+bool psastroZeroPointReadout(psArray *rawstars, psArray *refstars, psArray *matches);
 
 bool psastroZeroPoint (pmConfig *config) {
 
-    bool status;
     pmChip *chip = NULL;
     pmCell *cell = NULL;
     pmReadout *readout = NULL;
-    psArray *gradients = NULL;
 
     // select the current recipe
@@ -27,4 +25,11 @@
 
     pmFPAview *view = pmFPAviewAlloc (0);
+
+    // given the existing per-chip astrometry, determine matches between raw and ref stars
+    // is this needed? yes, if we didn't do SingleChip astrometry first
+    if (!psastroMosaicSetMatch (fpa, recipe, 0)) {
+	psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic");
+	return false;
+    }
 
     // this loop selects the matched stars for all chips
@@ -51,9 +56,9 @@
 		if (refstars == NULL) { continue; }
 
-		psArray *match = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH");
-		if (match == NULL) { continue; }
+		psArray *matches = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH");
+		if (matches == NULL) { continue; }
 
 		// calculate dMag for the matched stars
-		GetZeroPoint (rawstars, refstars, matches);
+		psastroZeroPointReadout (rawstars, refstars, matches);
 	    }
 	}
@@ -65,5 +70,5 @@
 
 // XXX for now, let's just measure <dMag> and sigma_dMag
-bool GetZeroPoint(psArray *rawstars, psArray *refstars, psArray *matches) {
+bool psastroZeroPointReadout(psArray *rawstars, psArray *refstars, psArray *matches) {
 
     psVector *dMag  = psVectorAllocEmpty (100, PS_TYPE_F32);
