Index: trunk/psLib/src/dataManip/psStats.c
===================================================================
--- trunk/psLib/src/dataManip/psStats.c	(revision 2213)
+++ trunk/psLib/src/dataManip/psStats.c	(revision 2217)
@@ -9,7 +9,7 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 20:11:47 $
- *
+ *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 21:06:30 $
+n *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
@@ -39,19 +39,14 @@
 /* DEFINE STATEMENTS                                                         */
 /*****************************************************************************/
-// will use robust statistical methods.
-#define GAUSS_WIDTH 5       // The width of the Gaussian or boxcar smoothing.
-#define CLIPPED_NUM_ITER_LB 1
-#define CLIPPED_NUM_ITER_UB 10
-#define CLIPPED_SIGMA_LB 1.0
-#define CLIPPED_SIGMA_UB 10.0
-#define true 1
-#define false 0
-#define MY_MAX_FLOAT HUGE
-#define MAX_ITERATIONS 10
-
-void p_psVectorRobustStats(const psVector* restrict myVector,
-                           const psVector* restrict maskVector, psU32 maskVal, psStats* stats);
-
-
+#define PS_GAUSS_WIDTH 5       // The width of the Gaussian or boxcar smoothing.
+#define PS_CLIPPED_NUM_ITER_LB 1
+#define PS_CLIPPED_NUM_ITER_UB 10
+#define PS_CLIPPED_SIGMA_LB 1.0
+#define PS_CLIPPED_SIGMA_UB 10.0
+#define PS_MAX_FLOAT HUGE
+#define PS_POLY_MEDIAN_MAX_ITERATIONS 10
+
+#define PS_BIN_MIDPOINT(HISTOGRAM, BIN_NUM) \
+(0.5 * (HISTOGRAM->bounds->data.F32[(BIN_NUM)] + HISTOGRAM->bounds->data.F32[(BIN_NUM)+1]))
 /*****************************************************************************/
 /* TYPE DEFINITIONS                                                          */
@@ -59,4 +54,8 @@
 psVector* p_psConvertToF32(psVector* in);
 
+void p_psVectorRobustStats(const psVector* restrict myVector,
+                           const psVector* restrict maskVector,
+                           psU32 maskVal,
+                           psStats* stats);
 /*****************************************************************************/
 /* GLOBAL VARIABLES                                                          */
@@ -245,5 +244,5 @@
 {
     psS32 i = 0;                  // Loop index variable
-    float max = -MY_MAX_FLOAT;  // The calculated maximum
+    float max = -PS_MAX_FLOAT;  // The calculated maximum
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -306,5 +305,5 @@
 {
     psS32 i = 0;                  // Loop index variable
-    float min = MY_MAX_FLOAT;   // The calculated maximum
+    float min = PS_MAX_FLOAT;   // The calculated maximum
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -493,5 +492,4 @@
 robustHistogram with a Gaussian of width sigma.
  *****************************************************************************/
-#define GAUSS_WIDTH_OTHER 5.0
 psVector* p_psVectorSmoothHistGaussian(psHistogram* robustHistogram,
                                        float sigma)
@@ -521,5 +519,5 @@
         // warnings?
 
-        x.data.F32 = iMid - (GAUSS_WIDTH * sigma);
+        x.data.F32 = iMid - (PS_GAUSS_WIDTH * sigma);
         if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) {
             jMin = p_psVectorBinDisect(robustHistogram->bounds, &x);
@@ -531,5 +529,5 @@
         }
 
-        x.data.F32 = iMid + (GAUSS_WIDTH * sigma);
+        x.data.F32 = iMid + (PS_GAUSS_WIDTH * sigma);
         if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) {
             jMax = p_psVectorBinDisect(robustHistogram->bounds, &x);
@@ -744,9 +742,9 @@
 
     // Endure that stats->clipIter is within the proper range.
-    if (!((CLIPPED_NUM_ITER_LB <= stats->clipIter) && (stats->clipIter <= CLIPPED_NUM_ITER_UB))) {
+    if (!((PS_CLIPPED_NUM_ITER_LB <= stats->clipIter) && (stats->clipIter <= PS_CLIPPED_NUM_ITER_UB))) {
         psAbort(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);
     }
     // Endure that stats->clipSigma is within the proper range.
-    if (!((CLIPPED_SIGMA_LB <= stats->clipSigma) && (stats->clipSigma <= CLIPPED_SIGMA_UB))) {
+    if (!((PS_CLIPPED_SIGMA_LB <= stats->clipSigma) && (stats->clipSigma <= PS_CLIPPED_SIGMA_UB))) {
         psAbort(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);
     }
@@ -996,5 +994,5 @@
     // printf("p_ps1DPolyMedian(%f, %f, %f) \n", rangeLow, rangeHigh, getThisValue);
 
-    while (numIterations < MAX_ITERATIONS) {
+    while (numIterations < PS_POLY_MEDIAN_MAX_ITERATIONS) {
         midpoint = (rangeHigh + rangeLow) / 2.0;
         if (fabs(midpoint - oldMidpoint) <= FLT_EPSILON) {
@@ -1099,7 +1097,4 @@
     return(tmpFloat);
 }
-
-#define PS_BIN_MIDPOINT(HISTOGRAM, BIN_NUM) \
-(0.5 * (HISTOGRAM->bounds->data.F32[(BIN_NUM)] + HISTOGRAM->bounds->data.F32[(BIN_NUM)+1]))
 
 /******************************************************************************
