Index: trunk/ppImage/src/ppImageLoop.c
===================================================================
--- trunk/ppImage/src/ppImageLoop.c	(revision 7592)
+++ trunk/ppImage/src/ppImageLoop.c	(revision 7621)
@@ -37,7 +37,4 @@
 		if (!ppImageDetrendReadout (config, options, view)) return false;
 
-		if (options->doBin1) ppImageRebinReadout (config, view, "PPIMAGE.BIN1");
-		if (options->doBin2) ppImageRebinReadout (config, view, "PPIMAGE.BIN2");
-
 		if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false;
 	    }
@@ -45,5 +42,7 @@
 	}
 
-	ppImageMosaicChip (chip, config, view);
+	ppImageMosaicChip (config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT");
+	ppImageRebinChip (config, view, "PPIMAGE.BIN1", "PPIMAGE.OUTPUT.CHIP");
+	ppImageRebinChip (config, view, "PPIMAGE.BIN2", "PPIMAGE.OUTPUT.CHIP");
 
 	// we perform photometry on the readouts of this chip in the output
@@ -53,10 +52,10 @@
     }
 
+    ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1");
+    ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2");
+
     // we perform astrometry on all chips after sources have been detected
-    if (options->doAstrom) ppImageAstrom (config);
+    if (options->doAstromChip || options->doAstromMosaic) ppImageAstrom (config);
     
-    // ppImageFPAMosaic (config, view);
-    // ppImageJpegFPA (config, view);
-
     if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false;
 
@@ -67,2 +66,7 @@
 // input image is: PPIMAGE.INPUT
 // output image is: PPIMAGE.OUTPUT
+
+// XXX need to be careful in ppImage in general about which pmFPAfiles are active and when.
+// major phases:
+// - detrend loop
+// - 
