Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysis.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysis.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysis.c	(revision 30140)
@@ -133,5 +133,5 @@
 	radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0);
 	radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0);
-	pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius);
+	pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius, false);
 
 	// if we request any of these measurements, we require the radial profile
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysisByObject.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysisByObject.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceAnalysisByObject.c	(revision 30140)
@@ -114,5 +114,5 @@
 	    radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0);
 	    radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0);
-	    pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius);
+	    pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius, false);
 
 	    // if we request any of these measurements, we require the radial profile
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinear.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinear.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinear.c	(revision 30140)
@@ -297,4 +297,5 @@
     psLogMsg ("psphot.ensemble", PS_LOG_INFO, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear"));
 
+    psphotVisualShowImage (readout);
     psphotVisualShowResidualImage (readout);
     psphotVisualPlotChisq (sources);
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinearStack.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinearStack.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotFitSourcesLinearStack.c	(revision 30140)
@@ -176,5 +176,4 @@
 
     psLogMsg ("psphot.ensemble", PS_LOG_INFO, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear"));
-
     return true;
 }
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotMakePSFReadout.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotMakePSFReadout.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotMakePSFReadout.c	(revision 30140)
@@ -60,5 +60,5 @@
     // Use bright stellar objects to measure PSF. If we do not have enough stars to generate
     // the PSF, build one from the SEEING guess and model class
-    if (!psphotChoosePSF (config, view, filerule)) {
+    if (!psphotChoosePSF (config, view, filerule, true)) {
 	psLogMsg ("psphot", 3, "failure to construct a psf model");
 	return psphotReadoutCleanup (config, view, filerule);
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialApertures.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialApertures.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialApertures.c	(revision 30140)
@@ -119,5 +119,5 @@
 	radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0);
 	radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0);
-	pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius);
+	pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius, false);
 
 	if (!psphotRadialApertureSource (source, recipe, skynoise, maskVal, radMax, 0)) {
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialAperturesByObject.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialAperturesByObject.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotRadialAperturesByObject.c	(revision 30140)
@@ -138,5 +138,5 @@
 	    // radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0);
 	    // radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0);
-	    pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, outerRadius + 2);
+	    pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, outerRadius + 2, false);
 
 	    if (!psphotRadialApertureSource (source, recipe, skynoise, maskVal, radMax, nMatchedPSF)) {
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotRadiusChecks.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotRadiusChecks.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotRadiusChecks.c	(revision 30140)
@@ -77,5 +77,5 @@
     source->apRadius = PSF_APERTURE;
 
-    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);
+    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, false);
 
     // set the mask to flag the excluded pixels
@@ -115,5 +115,5 @@
     source->apRadius = PSF_APERTURE;
 
-    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);
+    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, false);
 
     // set the mask to flag the excluded pixels
@@ -172,5 +172,5 @@
 
     // redefine the pixels if needed
-    pmSourceRedefinePixels (source, readout, peak->xf, peak->yf, rawRadius);
+    pmSourceRedefinePixels (source, readout, peak->xf, peak->yf, rawRadius, false);
 
     // set the mask to flag the excluded pixels
@@ -199,5 +199,5 @@
 
     // redefine the pixels if needed
-    pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);
+    pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, false);
 
     // set the mask to flag the excluded pixels
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotReadout.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotReadout.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotReadout.c	(revision 30140)
@@ -112,5 +112,5 @@
     // use bright stellar objects to measure PSF if we were supplied a PSF for any input file,
     // this step is skipped
-    if (!psphotChoosePSF (config, view, filerule)) { // pass 1
+    if (!psphotChoosePSF (config, view, filerule, true)) { // pass 1
         psLogMsg ("psphot", 3, "failure to construct a psf model");
         return psphotReadoutCleanup (config, view, filerule);
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotReadoutFindPSF.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotReadoutFindPSF.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotReadoutFindPSF.c	(revision 30140)
@@ -49,5 +49,5 @@
     }
 
-    if (!psphotChoosePSF(config, view, filerule)) {
+    if (!psphotChoosePSF(config, view, filerule, true)) {
         psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
         return psphotReadoutCleanup (config, view, filerule);
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotStackMatchPSFsUtils.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotStackMatchPSFsUtils.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotStackMatchPSFsUtils.c	(revision 30140)
@@ -383,4 +383,10 @@
 	goto escape;
     }
+
+    // save the PSF on the new readout->analysis:
+    // if (!psMetadataAddPtr (readoutOut->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", options->psf)) {
+    //     psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout");
+    //     return false;
+    // }
 
     // dumpImage(readoutOut, readoutSrc, index, "conv");
Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotVisual.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotVisual.c	(revision 30139)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotVisual.c	(revision 30140)
@@ -2408,5 +2408,6 @@
     if (myKapa == -1) return false;
 
-    psphotVisualScaleImage (myKapa, readout->image, readout->mask, "resid", 1);
+    psphotVisualScaleImage (myKapa, readout->variance, readout->mask, "variance", 1);
+    psphotVisualScaleImage (myKapa, readout->image, readout->mask, "resid", 0);
 
     pmVisualAskUser(NULL);
