Index: /branches/cnb_branch_20081010/psastro/src/Makefile.am
===================================================================
--- /branches/cnb_branch_20081010/psastro/src/Makefile.am	(revision 20057)
+++ /branches/cnb_branch_20081010/psastro/src/Makefile.am	(revision 20058)
@@ -29,5 +29,5 @@
 	psastroDataSave.c           \
 	psastroMetadataStats.c      \
-	psastroCleanup.c
+	psastroCleanup.c            
 
 psastroModel_SOURCES = \
@@ -53,4 +53,5 @@
 	psastroErrorCodes.c         \
 	psastroVersion.c            \
+	psastroVisual.c             \
 	psastroDefineFiles.c        \
 	psastroAnalysis.c           \
@@ -81,5 +82,5 @@
 	psastroZeroPoint.c    	    \
 	psastroDemoDump.c           \
-	psastroDemoPlot.c
+	psastroDemoPlot.c           
 
 include_HEADERS = \
Index: /branches/cnb_branch_20081010/psastro/src/psastro.h
===================================================================
--- /branches/cnb_branch_20081010/psastro/src/psastro.h	(revision 20057)
+++ /branches/cnb_branch_20081010/psastro/src/psastro.h	(revision 20058)
@@ -71,4 +71,9 @@
 bool              psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration);
 
+// psastroVisual.c functions
+bool psastroSetVisual (bool mode);
+bool psastroVisualPlotLuminosityFunction (psVector *lnMag, psVector *Mag, pmLumFunc *lumFunc, pmLumFunc *rawFunc);
+
+
 // Return version strings.
 psString          psastroVersion(void);
Index: /branches/cnb_branch_20081010/psastro/src/psastroArguments.c
===================================================================
--- /branches/cnb_branch_20081010/psastro/src/psastroArguments.c	(revision 20057)
+++ /branches/cnb_branch_20081010/psastro/src/psastroArguments.c	(revision 20058)
@@ -37,5 +37,5 @@
         psArgumentRemove (N, &argc, argv);
     }
-    
+
     // apply the chip correction based on the reference astrometry?
     if ((N = psArgumentGet (argc, argv, "-fixchips"))) {
@@ -51,5 +51,5 @@
     status = pmConfigFileSetsMD (config->arguments, &argc, argv, "ASTROM.MODEL", "-astrommodel", "-astrommodellist");
     if (status) {
-	// if supplied, assume -fixchips is desired
+        // if supplied, assume -fixchips is desired
         psMetadataAddBool (config->arguments, PS_LIST_TAIL, "PSASTRO.FIX.CHIPS", PS_META_REPLACE, "", true);
     }
@@ -88,4 +88,10 @@
     }
 
+    // show visual diagnostics?
+    if ((N = psArgumentGet(argc, argv, "-visual"))) {
+        psArgumentRemove (N, &argc, argv);
+        psastroSetVisual (true);
+    }
+
     status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
     if (!status) {
Index: /branches/cnb_branch_20081010/psastro/src/psastroLuminosityFunction.c
===================================================================
--- /branches/cnb_branch_20081010/psastro/src/psastroLuminosityFunction.c	(revision 20057)
+++ /branches/cnb_branch_20081010/psastro/src/psastroLuminosityFunction.c	(revision 20058)
@@ -129,4 +129,5 @@
     lumFunc->sPeak = sPeak;
 
+    psastroVisualPlotLuminosityFunction(lnMag, Mag, lumFunc, rawFunc);
 #if 0
     psastroLuminosityFunctionPlot(lnMag, Mag, lumFunc, rawFunc);
