Index: trunk/psModules/src/imcombine/pmReadoutCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 9541)
+++ trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 9611)
@@ -1,15 +1,2 @@
-/** @file  pmReadoutCombine.c
- *
- *  This file will contain a module which will combine multiple readout images.
- *
- *  @author GLG, MHPCC
- *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 22:11:02 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -27,43 +14,5 @@
 #include "pmReadoutCombine.h"
 
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// File-static (private) functions
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// Return the statistic of interest
-static inline double getStat(const psStats *stats, // Statistics structure
-                             psStatsOptions option // Statistics option
-                            )
-{
-    assert(stats);
-
-    switch (option) {
-    case PS_STAT_SAMPLE_MEAN:
-        return stats->sampleMean;
-    case PS_STAT_SAMPLE_MEDIAN:
-        return stats->sampleMedian;
-    case PS_STAT_SAMPLE_STDEV:
-        return stats->sampleStdev;
-    case PS_STAT_ROBUST_MEDIAN:
-        return stats->robustMedian;
-    case PS_STAT_ROBUST_STDEV:
-        return stats->robustStdev;
-    case PS_STAT_FITTED_MEAN:
-        return stats->fittedMean;
-    case PS_STAT_FITTED_STDEV:
-        return stats->fittedStdev;
-    case PS_STAT_CLIPPED_MEAN:
-        return stats->clippedMean;
-    case PS_STAT_CLIPPED_STDEV:
-        return stats->clippedStdev;
-    case PS_STAT_MAX:
-        return stats->max;
-    case PS_STAT_MIN:
-        return stats->min;
-    default:
-        psAbort(__func__, "Bad option: %x\n", option);
-    }
-    return NAN;
-}
+//#define SHOW_BUSY 1                   // Show that the function is busy
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -82,5 +31,5 @@
     params->fracHigh = 0.0;
     params->iter = 1;
-    params->rej = 3.0;
+    params->rej = INFINITY;
 
     return params;
@@ -88,17 +37,11 @@
 
 
-/******************************************************************************
-XXX: Maybe add support for S16 and S32 types.  Currently, only F32 supported.
- *****************************************************************************/
-bool pmReadoutCombine(pmReadout *output,
-                      psArray *inputs,
-                      const psVector *zero,
-                      const psVector *scale,
-                      pmCombineParams *params
-                     )
+// XXX: Maybe add support for S16 and S32 types.  Currently, only F32 supported.
+bool pmReadoutCombine(pmReadout *output, const psArray *inputs, const psVector *zero, const psVector *scale,
+                      const pmCombineParams *params)
 {
     // Check inputs
     PS_ASSERT_PTR_NON_NULL(output, false);
-    PS_ASSERT_PTR_NON_NULL(inputs, false);
+    PS_ASSERT_ARRAY_NON_NULL(inputs, false);
     PS_ASSERT_PTR_NON_NULL(params, false);
     if (zero) {
@@ -307,5 +250,5 @@
     for (int i = minInputRows; i < maxInputRows; i++) {
         int yOut = i - output->row0; // y position on output readout
-        #if 0
+        #ifdef SHOW_BUSY
 
         if (psTraceGetLevel("psModules.imcombine") > 9) {
@@ -325,6 +268,5 @@
                 psImage *image = readout->image; // The readout image
 
-                #if 0
-                // This should have been taken care of already:
+                #if 0 // This should have been taken care of already:
                 // Check bounds
                 if (xIn < 0 || xIn >= image->numCols || yIn < 0 || yIn >= image->numRows) {
@@ -382,12 +324,12 @@
             // Combination
             psVectorStats(stats, pixels, weights, mask, 1);
-            outputImage[yOut][xOut] = getStat(stats, params->combine);
+            outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine);
             if (haveWeights) {
-                float stdev = getStat(stats, combineStdev);
+                float stdev = psStatsGetValue(stats, combineStdev);
                 outputWeight[yOut][xOut] = PS_SQR(stdev); // Variance
             }
         }
     }
-    #if 0
+    #ifdef SHOW_BUSY
     if (psTraceGetLevel("psModules.imcombine") > 9) {
         printf("\n");
