Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotFitSourcesLinear.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotFitSourcesLinear.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotFitSourcesLinear.c	(revision 32924)
@@ -137,4 +137,9 @@
 	// psAssert (source->peak, "source without peak??");
 	// psAssert (source->peak->footprint, "peak without footprint??");
+
+	// XXX TEST
+        if (source->mode2 & PM_SOURCE_MODE2_MATCHED) {
+	    fprintf (stderr, "forced photometry on supplied source\n");
+	}
 
         // turn this bit off and turn it on again if we pass this test
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotForcedReadout.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotForcedReadout.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotForcedReadout.c	(revision 32924)
@@ -55,5 +55,6 @@
     psphotLoadExtSources (config, view, filerule);
 
-    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
     psphotGuessModels (config, view, filerule);
 
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotGuessModels.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotGuessModels.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotGuessModels.c	(revision 32924)
@@ -46,5 +46,5 @@
     psAssert (detections, "missing detections?");
 
-    psArray *sources = detections->newSources;
+    psArray *sources = detections->allSources;
     psAssert (sources, "missing sources?");
 
@@ -160,4 +160,7 @@
         pmSource *source = sources->data[i];
 
+	// do not redo sources already guessed
+	if (source->tmpFlags & PM_SOURCE_TMPF_MODEL_GUESS) continue;
+
         // this is used to mark sources for which the model is measured. We check later that
         // all are used.
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotReadout.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotReadout.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotReadout.c	(revision 32924)
@@ -127,11 +127,11 @@
     // psphotLoadExtSources (config, view, filerule); // pass 1
 
-    // construct an initial model for each object, set the radius to fitRadius, set circular
-    // fit mask (detections->newSources)
-    psphotGuessModels (config, view, filerule); // pass 1
-
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
     psphotMergeSources (config, view, filerule);
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, filerule); // pass 1
 
     // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
@@ -193,8 +193,4 @@
 	}
 
-	// create full input models, set the radius to fitRadius, set circular fit mask
-	// NOTE: apply only to detections->newSources
-	psphotGuessModels (config, view, filerule); // pass 2 (detections->newSources)
-
 	// replace all sources so fit below applies to all at once
 	// NOTE: apply only to OLD sources (which have been subtracted)
@@ -205,4 +201,8 @@
 	// XXX check on free of sources...
 	psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources)
+
+	// Construct an initial model for each object, set the radius to fitRadius, set circular
+	// fit mask.  NOTE: only applied to sources without guess models
+	psphotGuessModels (config, view, filerule); // pass 1
 
 	// NOTE: apply to ALL sources
@@ -234,8 +234,4 @@
 	}
 
-	// create full input models, set the radius to fitRadius, set circular fit mask
-	// NOTE: apply only to detections->newSources
-	psphotGuessModels (config, view, filerule); // pass 2 (detections->newSources)
-
 	// replace all sources so fit below applies to all at once
 	// NOTE: apply only to OLD sources (which have been subtracted)
@@ -247,4 +243,8 @@
 	psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources)
 
+	// Construct an initial model for each object, set the radius to fitRadius, set circular
+	// fit mask.  NOTE: only applied to sources without guess models
+	psphotGuessModels (config, view, filerule); // pass 1
+
 	// NOTE: apply to ALL sources
 	psphotFitSourcesLinear (config, view, filerule, true); // pass 3 (detections->allSources)
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutFindPSF.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutFindPSF.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutFindPSF.c	(revision 32924)
@@ -54,4 +54,8 @@
     }
 
+    // merge the newly selected sources into the existing list
+    // NOTE: merge OLD and NEW
+    psphotMergeSources (config, view, filerule); 
+
 # if 0
     // XXX if we want to determine the aperture residual correction here, we either
@@ -61,8 +65,4 @@
     psphotGuessModels (config, view, filerule);
 # endif
-
-    // merge the newly selected sources into the existing list
-    // NOTE: merge OLD and NEW
-    psphotMergeSources (config, view, filerule); 
 
 # if 0
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutForcedKnownSources.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutForcedKnownSources.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutForcedKnownSources.c	(revision 32924)
@@ -36,10 +36,11 @@
     }
 
-    // construct an initial model for each object
-    psphotGuessModels (config, view, filerule);
-
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
     psphotMergeSources (config, view, filerule); 
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, filerule);
 
     // linear PSF fit to source peaks
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutKnownSources.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutKnownSources.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutKnownSources.c	(revision 32924)
@@ -48,10 +48,11 @@
     }
 
-    // construct an initial model for each object
-    psphotGuessModels (config, view, filerule);
-
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
     psphotMergeSources (config, view, filerule); 
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, filerule);
 
     // linear PSF fit to source peaks
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutMinimal.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutMinimal.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotReadoutMinimal.c	(revision 32924)
@@ -59,9 +59,10 @@
     }
 
-    // construct an initial model for each object
-    psphotGuessModels (config, view, filerule);
-
     // merge the newly selected sources into the existing list
     psphotMergeSources (config, view, filerule);
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, filerule);
 
     // linear PSF fit to source peaks
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotSourceMatch.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotSourceMatch.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotSourceMatch.c	(revision 32924)
@@ -261,4 +261,5 @@
 	    source->imageID = index;
 	    source->mode2 |= PM_SOURCE_MODE2_MATCHED; // source is generated based on another image
+	    source->type = PM_SOURCE_TYPE_STAR; // until we know more, assume a PSF fit
 
 	    // add the peak
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotStackMatchPSFsNext.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotStackMatchPSFsNext.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotStackMatchPSFsNext.c	(revision 32924)
@@ -51,4 +51,6 @@
 
     bool status = false;
+
+    psTimerStart ("psphot.smooth");
 
     // find the currently selected readout
Index: /branches/eam_branches/ipp-20111122/psphot/src/psphotStackReadout.c
===================================================================
--- /branches/eam_branches/ipp-20111122/psphot/src/psphotStackReadout.c	(revision 32923)
+++ /branches/eam_branches/ipp-20111122/psphot/src/psphotStackReadout.c	(revision 32924)
@@ -160,10 +160,11 @@
     }
 
-    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
-    psphotGuessModels (config, view, STACK_SRC);
-
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
     psphotMergeSources (config, view, STACK_SRC);
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, STACK_SRC);
 
     // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
@@ -248,8 +249,4 @@
 	}
 
-	// create full input models, set the radius to fitRadius, set circular fit mask
-	// NOTE: apply only to detections->newSources
-	psphotGuessModels (config, view, STACK_SRC); // pass 2 (detections->newSources)
-
 	// replace all sources so fit below applies to all at once
 	// NOTE: apply only to OLD sources (which have been subtracted)
@@ -260,4 +257,8 @@
 	// XXX check on free of sources...
 	psphotMergeSources (config, view, STACK_SRC); // (detections->newSources + detections->allSources -> detections->allSources)
+
+	// Construct an initial model for each object, set the radius to fitRadius, set circular
+	// fit mask.  NOTE: only applied to sources without guess models
+	psphotGuessModels (config, view, STACK_SRC);
     }
 
@@ -269,4 +270,8 @@
     objects = psphotMatchSources (config, view, STACK_SRC);
     psMemDump("matchsources");
+
+    // Construct an initial model for each object, set the radius to fitRadius, set circular
+    // fit mask.  NOTE: only applied to sources without guess models
+    psphotGuessModels (config, view, STACK_SRC);
 
     psphotStackObjectsUnifyPosition (objects);
