Index: /branches/eam_branches/ipp-20100823/psphot/src/psphot.h
===================================================================
--- /branches/eam_branches/ipp-20100823/psphot/src/psphot.h	(revision 29463)
+++ /branches/eam_branches/ipp-20100823/psphot/src/psphot.h	(revision 29464)
@@ -264,4 +264,5 @@
 bool            psphotVisualShowPetrosians (psArray *sources);
 bool            psphotVisualEraseOverlays (int channel, char *overlay);
+bool            psphotVisualClose(void);
 
 bool psphotPetrosian (pmSource *source, psMetadata *recipe, float skynoise, psImageMaskType maskVal);
Index: /branches/eam_branches/ipp-20100823/psphot/src/psphotApResid.c
===================================================================
--- /branches/eam_branches/ipp-20100823/psphot/src/psphotApResid.c	(revision 29463)
+++ /branches/eam_branches/ipp-20100823/psphot/src/psphotApResid.c	(revision 29464)
@@ -48,4 +48,14 @@
     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     psAssert (readout, "missing readout?");
+
+    // XXX TEST output
+    { 
+	char outname[64];
+	static int nimage = 0;
+
+	sprintf (outname, "testimage.%02d.fits", nimage);
+	psphotSaveImage(NULL, readout->image, outname);
+	nimage ++;
+    }
 
     pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
Index: /branches/eam_branches/ipp-20100823/psphot/src/psphotExtendedSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20100823/psphot/src/psphotExtendedSourceFits.c	(revision 29463)
+++ /branches/eam_branches/ipp-20100823/psphot/src/psphotExtendedSourceFits.c	(revision 29464)
@@ -179,4 +179,16 @@
 		    return false;
 		}
+                psScalar *scalar = NULL;
+                scalar = job->args->data[7];
+                Next += scalar->data.S32;
+                scalar = job->args->data[8];
+                Nconvolve += scalar->data.S32;
+                scalar = job->args->data[9];
+                NconvolvePass += scalar->data.S32;
+                scalar = job->args->data[10];
+                Nplain += scalar->data.S32;
+                scalar = job->args->data[11];
+                NplainPass += scalar->data.S32;
+		psFree(job);
 	    }
         }
