Index: trunk/ppSub/src/ppSub.c
===================================================================
--- trunk/ppSub/src/ppSub.c	(revision 21396)
+++ trunk/ppSub/src/ppSub.c	(revision 21424)
@@ -6,6 +6,6 @@
  *
  *  @author IfA
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-02-06 01:37:17 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-09 21:26:05 $
  *  Copyright 2009 Institute for Astronomy, University of Hawaii
  */
@@ -66,4 +66,5 @@
     psTimerStop();
 
+    pmSubtractionVisualClose(); //close plot windows, if -visual is set
     psFree(config);
     pmModelClassCleanup();
Index: trunk/ppSub/src/ppSubArguments.c
===================================================================
--- trunk/ppSub/src/ppSubArguments.c	(revision 21396)
+++ trunk/ppSub/src/ppSubArguments.c	(revision 21424)
@@ -6,6 +6,6 @@
  *
  *  @author IfA
- *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-02-07 00:15:00 $
+ *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-09 21:26:05 $
  *  Copyright 2009 Institute for Astronomy, University of Hawaii
  */
@@ -252,4 +252,5 @@
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-bin2", 0, "Binning factor for second level", 0);
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-dumpconfig", 0, "file to dump configuration to", NULL);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "-visual", 0, "Show diagnostic plots", NULL);
 
     if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 4) {
@@ -365,4 +366,8 @@
     }
 
+    if (psMetadataLookupBool(NULL, arguments, "-visual")) {
+        pmSubtractionSetVisual(true);
+    }
+
     // Translate the kernel type
     psString type = psMetadataLookupStr(NULL, arguments, "-type"); // Name of kernel type
Index: trunk/ppSub/src/ppSubReadout.c
===================================================================
--- trunk/ppSub/src/ppSubReadout.c	(revision 21396)
+++ trunk/ppSub/src/ppSubReadout.c	(revision 21424)
@@ -6,6 +6,6 @@
  *
  *  @author IfA
- *  @version $Revision: 1.111 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-02-06 01:37:17 $
+ *  @version $Revision: 1.112 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-09 21:26:05 $
  *  Copyright 2009 Institute for Astronomy, University of Hawaii
  */
@@ -52,5 +52,5 @@
         return false;
     }
- 
+
     if (!ppSubReadoutPhotometry (config, stats, view)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to subtract background.");
Index: trunk/ppSub/src/ppSubReadoutSubtract.c
===================================================================
--- trunk/ppSub/src/ppSubReadoutSubtract.c	(revision 21396)
+++ trunk/ppSub/src/ppSubReadoutSubtract.c	(revision 21424)
@@ -6,6 +6,6 @@
  *
  *  @author IfA
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-02-06 03:20:02 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-09 21:26:05 $
  *  Copyright 2009 Institute for Astronomy, University of Hawaii
  */
@@ -63,4 +63,6 @@
     outRO->parent->parent->data_exists = true;
 
+    pmSubtractionVisualShowSubtraction(minuend->image, subtrahend->image, outRO->image);
+
     // copy concepts from the input to the output (XXX should this always use minuend?)
     pmFPAfile *inFile = psMetadataLookupPtr (&mdok, config->files, "PPSUB.INPUT");
