Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 8232)
+++ trunk/psLib/src/math/psStats.c	(revision 8245)
@@ -16,6 +16,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.183 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-08 23:32:23 $
+ *  @version $Revision: 1.184 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-09 02:26:44 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -110,5 +110,5 @@
                              psStats* stats)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
 
     psF32 mean = 0.0;                   // The mean
@@ -221,9 +221,9 @@
     stats->sampleMean = mean;
     if (isnan(mean)) {
-        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
         return false;
     }
 
-    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     return true;
 }
@@ -240,5 +240,5 @@
                         )
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     psF32 max = -PS_MAX_F32;            // The calculated maximum
     psF32 min = PS_MAX_F32;             // The calculated minimum
@@ -316,5 +316,5 @@
         stats->min = min;
     }
-    psTrace(__func__, 4, "---- %s(%d) end ----\n", __func__, numValid);
+    psTrace("psLib.math", 4, "---- %s(%d) end ----\n", __func__, numValid);
     return numValid;
 }
@@ -332,5 +332,5 @@
                                 psStats* stats)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_VECTOR_NON_NULL(myVector, false);
     PS_ASSERT_PTR_NON_NULL(stats, false);
@@ -342,5 +342,5 @@
                         (stats->min <= myVector->data.F32[i]) &&
                         (myVector->data.F32[i] <= stats->max)) {
-                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
                     return true;
                 }
@@ -350,5 +350,5 @@
                 if ((stats->min <= myVector->data.F32[i]) &&
                         (myVector->data.F32[i] <= stats->max)) {
-                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
                     return true;
                 }
@@ -359,5 +359,5 @@
             for (long i = 0; i < myVector->n; i++) {
                 if (!(maskVal & maskVector->data.U8[i])) {
-                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
                     return true;
                 }
@@ -365,10 +365,10 @@
         } else {
             if (myVector->n > 0) {
-                psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+                psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
                 return true;
             }
         }
     }
-    psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
     return(false);
 }
@@ -385,5 +385,5 @@
                                psStats* stats)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
 
     // Allocate temporary vectors for the data.
@@ -441,5 +441,5 @@
                 false,
                 _("Failed to sort input data."));
-        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
         psFree(vector);
         return false;
@@ -463,5 +463,5 @@
 
     // Return "true" on success.
-    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     return true;
 }
@@ -475,6 +475,6 @@
                                    psF32 sigma)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
-    psTrace(__func__, 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
     PS_ASSERT_PTR_NON_NULL(histogram, NULL);
     PS_ASSERT_PTR_NON_NULL(histogram->bounds, NULL);
@@ -564,5 +564,5 @@
         PS_VECTOR_PRINT_F32(smooth);
     }
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     return(smooth);
 }
@@ -586,5 +586,5 @@
                               psStats* stats)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
 
     // This procedure requires the mean.  If it has not been already
@@ -597,5 +597,5 @@
         stats->sampleStdev = NAN;
         psLogMsg(__func__, PS_LOG_WARN, "WARNING: vectorSampleStdev(): vectorSampleMean() reported a NAN mean.\n");
-        psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
         return false;
     }
@@ -680,5 +680,5 @@
                                   (float)(count - 1));
     }
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
 
     return true;
@@ -704,6 +704,6 @@
                               )
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
-    psTrace(__func__, 4, "Trace level is %d\n", psTraceGetLevel(__func__));
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "Trace level is %d\n", psTraceGetLevel(__func__));
 
     // Ensure that stats->clipIter is within the proper range.
@@ -739,10 +739,10 @@
         stats->clippedMean = NAN;
         stats->clippedStdev = NAN;
-        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
         psFree(tmpMask);
         psFree(statsTmp);
         return false;
     }
-    psTrace(__func__, 6, "The initial sample median is %f\n", statsTmp->sampleMedian);
+    psTrace("psLib.math", 6, "The initial sample median is %f\n", statsTmp->sampleMedian);
 
     // 2. Compute the sample standard deviation.
@@ -752,10 +752,10 @@
         stats->clippedMean = NAN;
         stats->clippedStdev = NAN;
-        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
         psFree(tmpMask);
         psFree(statsTmp);
         return false;
     }
-    psTrace(__func__, 6, "The initial sample stdev is %f\n", statsTmp->sampleStdev);
+    psTrace("psLib.math", 6, "The initial sample stdev is %f\n", statsTmp->sampleStdev);
 
     // 3. Use the sample median as the first estimator of the mean X.
@@ -770,5 +770,5 @@
     for (int iter = 0; iter < stats->clipIter && clipped; iter++) {
         clipped = false;
-        psTrace(__func__, 6, "------------ Iteration %d ------------\n", iter);
+        psTrace("psLib.math", 6, "------------ Iteration %d ------------\n", iter);
         // a) Exclude all values x_i for which |x_i - x| > K * stdev
         if (errors) {
@@ -777,5 +777,5 @@
                         fabsf(myVector->data.F32[j] - clippedMean) > stats->clipSigma * errors->data.F32[j]) {
                     tmpMask->data.U8[j] = 0xff;
-                    psTrace(__func__, 10, "Clipped %d: %f +/- %f\n", j,
+                    psTrace("psLib.math", 10, "Clipped %d: %f +/- %f\n", j,
                             myVector->data.F32[j], errors->data.F32[j]);
                     numClipped++;
@@ -788,5 +788,5 @@
                         fabsf(myVector->data.F32[j] - clippedMean) > (stats->clipSigma * clippedStdev)) {
                     tmpMask->data.U8[j] = 0xff;
-                    psTrace(__func__, 10, "Clipped %d: %f\n", j, myVector->data.F32[j]);
+                    psTrace("psLib.math", 10, "Clipped %d: %f\n", j, myVector->data.F32[j]);
                     numClipped++;
                     clipped = true;
@@ -798,6 +798,6 @@
         vectorSampleMean(myVector, errors, tmpMask, maskVal, statsTmp);
         vectorSampleStdev(myVector, errors, tmpMask, maskVal, statsTmp);
-        psTrace(__func__, 6, "The new sample mean is %f\n", statsTmp->sampleMean);
-        psTrace(__func__, 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
+        psTrace("psLib.math", 6, "The new sample mean is %f\n", statsTmp->sampleMean);
+        psTrace("psLib.math", 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
 
         // If the new mean and stdev are NAN, we must exit the loop.
@@ -821,15 +821,15 @@
     if (stats->options & PS_STAT_CLIPPED_MEAN) {
         stats->clippedMean = clippedMean;
-        psTrace(__func__, 6, "The final clipped mean is %f\n", clippedMean);
+        psTrace("psLib.math", 6, "The final clipped mean is %f\n", clippedMean);
     }
     // 8. The last calcuated value of stdev is the clipped stdev.
     if (stats->options & PS_STAT_CLIPPED_STDEV) {
         stats->clippedStdev = clippedStdev;
-        psTrace(__func__, 6, "The final clipped stdev is %f\n", clippedStdev);
+        psTrace("psLib.math", 6, "The final clipped stdev is %f\n", clippedStdev);
     }
 
     psFree(tmpMask);
     psFree(statsTmp);
-    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     return true;
 }
@@ -884,6 +884,6 @@
                                               )
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
-    psTrace(__func__, 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
     if (psTraceGetLevel(__func__) >= 8) {
         PS_VECTOR_PRINT_F32(xVec);
@@ -913,8 +913,8 @@
         y->data.F64[1] = yVec->data.F32[binNum];
         y->data.F64[2] = yVec->data.F32[binNum + 1];
-        psTrace(__func__, 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
+        psTrace("psLib.math", 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
                 xVec->data.F32[binNum], xVec->data.F32[binNum+1], xVec->data.F32[binNum+2]);
-        psTrace(__func__, 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
-        psTrace(__func__, 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
+        psTrace("psLib.math", 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
+        psTrace("psLib.math", 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
 
         //
@@ -937,5 +937,5 @@
             psFree(x);
             psFree(y);
-            psTrace(__func__, 5, "---- %s() end ----\n", __func__);
+            psTrace("psLib.math", 5, "---- %s() end ----\n", __func__);
             return NAN;
         }
@@ -949,16 +949,16 @@
             psFree(x);
             psFree(y);
-            psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
+            psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
             return NAN;
         }
-        psTrace(__func__, 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
-        psTrace(__func__, 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
-        psTrace(__func__, 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
-        psTrace(__func__, 6, "Fitted y vec is (%f %f %f)\n",
+        psTrace("psLib.math", 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
+        psTrace("psLib.math", 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
+        psTrace("psLib.math", 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
+        psTrace("psLib.math", 6, "Fitted y vec is (%f %f %f)\n",
                 (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[0]),
                 (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[1]),
                 (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[2]));
 
-        psTrace(__func__, 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
+        psTrace("psLib.math", 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
         tmpFloat = QuadraticInverse(myPoly->coeff[2], myPoly->coeff[1], myPoly->coeff[0], yVal,
                                     x->data.F64[0], x->data.F64[2]);
@@ -970,5 +970,5 @@
             psFree(x);
             psFree(y);
-            psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
+            psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
             return(NAN);
         }
@@ -990,9 +990,9 @@
     }
 
-    psTrace(__func__, 6, "FIT: return %f\n", tmpFloat);
+    psTrace("psLib.math", 6, "FIT: return %f\n", tmpFloat);
     psFree(x);
     psFree(y);
 
-    psTrace(__func__, 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
+    psTrace("psLib.math", 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
     return tmpFloat;
 }
@@ -1006,5 +1006,5 @@
                                   )
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     PS_ASSERT_VECTOR_SIZE(params, 2, NAN);
@@ -1028,5 +1028,5 @@
 
 
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     return gauss;
 }
@@ -1057,5 +1057,5 @@
                               psStats* stats)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     if (psTraceGetLevel(__func__) >= 8) {
         PS_VECTOR_PRINT_F32(myVector);
@@ -1085,5 +1085,5 @@
     // Iterate to get the best bin size
     for (int iterate = 1; iterate > 0; iterate++) {
-        psTrace(__func__, 6,
+        psTrace("psLib.math", 6,
                 "-------------------- Iterating on Bin size.  Iteration number %d --------------------\n",
                 iterate);
@@ -1098,12 +1098,12 @@
             psFree(statsMinMax);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
-        psTrace(__func__, 6, "Data min/max is (%.2f, %.2f)\n", min, max);
+        psTrace("psLib.math", 6, "Data min/max is (%.2f, %.2f)\n", min, max);
 
         // If all data points have the same value, then we set the appropiate members of stats and return.
         if (fabs(max - min) <= FLT_EPSILON) {
-            psTrace(__func__, 5, "All data points have the same value: %f.\n", min);
+            psTrace("psLib.math", 5, "All data points have the same value: %f.\n", min);
             if (stats->options & PS_STAT_ROBUST_MEDIAN) {
                 stats->robustMedian = min;
@@ -1117,5 +1117,5 @@
             psFree(mask);
 
-            psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
             return false;
         }
@@ -1125,10 +1125,10 @@
             // Set initial bin size to the specified value.
             binSize = stats->binsize;
-            psTrace(__func__, 6, "Setting initial robust bin size to %.2f\n", binSize);
+            psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
         } else {
             // Determine the bin size of the robust histogram, using the pre-defined number of bins
             binSize = (max - min) / INITIAL_NUM_BINS;
         }
-        psTrace(__func__, 6, "Initial robust bin size is %.2f\n", binSize);
+        psTrace("psLib.math", 6, "Initial robust bin size is %.2f\n", binSize);
 
         // ADD step 0: Construct the histogram with the specified bin size.  NOTE: we can not specify the bin
@@ -1136,6 +1136,6 @@
         // we get here, we know that binSize != 0.0.
         long numBins = (max - min) / binSize; // Number of bins
-        psTrace(__func__, 6, "Numbins is %d\n", numBins);
-        psTrace(__func__, 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
+        psTrace("psLib.math", 6, "Numbins is %d\n", numBins);
+        psTrace("psLib.math", 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
         // Generate the histogram
         histogram = psHistogramAlloc(min, max, numBins);
@@ -1159,5 +1159,5 @@
         // ADD step 2: Find the bin which contains the 50% data point.
         totalDataPoints = cumulative->nums->data.F32[numBins - 1];
-        psTrace(__func__, 6, "Total data points is %d\n", totalDataPoints);
+        psTrace("psLib.math", 6, "Total data points is %d\n", totalDataPoints);
         long binMedian;
         if (totalDataPoints/2.0 < cumulative->nums->data.F32[0]) {
@@ -1175,9 +1175,9 @@
                 psFree(cumulative);
                 psFree(mask);
-                psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+                psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
                 return false;
             }
         }
-        psTrace(__func__, 6, "The median bin is %d (%.2f to %.2f)\n", binMedian,
+        psTrace("psLib.math", 6, "The median bin is %d (%.2f to %.2f)\n", binMedian,
                 cumulative->bounds->data.F32[binMedian], cumulative->bounds->data.F32[binMedian+1]);
 
@@ -1192,8 +1192,8 @@
             psFree(cumulative);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
-        psTrace(__func__, 6, "Current robust median is %f\n", stats->robustMedian);
+        psTrace("psLib.math", 6, "Current robust median is %f\n", stats->robustMedian);
 
         // ADD step 4: Find the bins which contains the 15.8655% and 84.1345% data points.
@@ -1217,8 +1217,8 @@
             }
         }
-        psTrace(__func__, 6, "The 15.8655%% and 84.1345%% data point bins are (%d, %d).\n",
+        psTrace("psLib.math", 6, "The 15.8655%% and 84.1345%% data point bins are (%d, %d).\n",
                 binLo, binHi);
-        psTrace(__func__, 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
-        psTrace(__func__, 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
+        psTrace("psLib.math", 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
+        psTrace("psLib.math", 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
 
         if ((binLo < 0) || (binHi < 0)) {
@@ -1228,5 +1228,5 @@
             psFree(cumulative);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1244,11 +1244,11 @@
         float binHiF32 = fitQuadraticSearchForYThenReturnX(cumulative->bounds, cumulative->nums, binHi,
                          totalDataPoints * 0.841345f);
-        psTrace(__func__, 6, "The exact 15.8655%% and 84.1345%% data point positions are: (%f, %f)\n",
+        psTrace("psLib.math", 6, "The exact 15.8655%% and 84.1345%% data point positions are: (%f, %f)\n",
                 binLoF32, binHiF32);
         #else
         // This code basically interpolates to find the positions exactly.
-        psTrace(__func__, 6, "binLo is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
+        psTrace("psLib.math", 6, "binLo is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
                 binLo, cumulative->nums->data.F32[binLo], cumulative->nums->data.F32[binLo+1]);
-        psTrace(__func__, 6, "binHi is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
+        psTrace("psLib.math", 6, "binHi is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
                 binHi, cumulative->nums->data.F32[binHi], cumulative->nums->data.F32[binHi+1]);
 
@@ -1266,5 +1266,5 @@
         float base = cumulative->bounds->data.F32[binLo];
         float binLoF32 = base + (deltaBounds / deltaNums) * percentNums; // Value for the 15.8655% mark
-        psTrace(__func__, 6,
+        psTrace("psLib.math", 6,
                 "(base, deltaBounds, deltaNums, prevPixels, percentNums) is (%.2f %.2f %.2f %.2f %.2f)\n",
                 base, deltaBounds, deltaNums, prevPixels, percentNums);
@@ -1281,8 +1281,8 @@
         base = cumulative->bounds->data.F32[binHi];
         float binHiF32 = base + (deltaBounds / deltaNums) * percentNums; // Value for the 84.1345% mark
-        psTrace(__func__, 6,
+        psTrace("psLib.math", 6,
                 "(base, deltaBounds, deltaNums, prevPixels, percentNums) is (%.2f %.2f %.2f %.2f %.2f)\n",
                 base, deltaBounds, deltaNums, prevPixels, percentNums);
-        psTrace(__func__, 6,
+        psTrace("psLib.math", 6,
                 "The exact 15.8655 and 84.1345 percent data point positions are: (%f, %f)\n",
                 binLoF32, binHiF32);
@@ -1291,5 +1291,5 @@
         // ADD step 5: Determine SIGMA as 1/2 of the distance between these positions.
         sigma = (binHiF32 - binLoF32) / 2.0;
-        psTrace(__func__, 6, "The current sigma is %f.\n", sigma);
+        psTrace("psLib.math", 6, "The current sigma is %f.\n", sigma);
         stats->robustStdev = sigma;
 
@@ -1297,18 +1297,18 @@
         // than 25 bins from the median, recalculate the bin size, and perform the algorithm again.
         if (sigma < (2 * binSize)) {
-            psTrace(__func__, 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
+            psTrace("psLib.math", 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
             long maskLo = PS_MAX(0, (binMedian - 25)); // Low index for masking region
             long maskHi = PS_MIN(histogram->bounds->n - 1, (binMedian + 25)); // High index for masking
             psF32 medianLo = histogram->bounds->data.F32[maskLo]; // Value at low index
             psF32 medianHi = histogram->bounds->data.F32[maskHi]; // Value at high index
-            psTrace(__func__, 6, "Masking data more than 25 bins from the median\n");
-            psTrace(__func__, 6,
+            psTrace("psLib.math", 6, "Masking data more than 25 bins from the median\n");
+            psTrace("psLib.math", 6,
                     "The median is at bin number %d.  We mask bins outside the bin range (%d:%d)\n",
                     binMedian, maskLo, maskHi);
-            psTrace(__func__, 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
+            psTrace("psLib.math", 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
             for (long i = 0 ; i < myVector->n ; i++) {
                 if ((myVector->data.F32[i] < medianLo) || (myVector->data.F32[i] > medianHi)) {
                     mask->data.U8[i] = 0xff;
-                    psTrace(__func__, 6, "Masking element %d is %f\n", i, myVector->data.F32[i]);
+                    psTrace("psLib.math", 6, "Masking element %d is %f\n", i, myVector->data.F32[i]);
                 }
             }
@@ -1318,5 +1318,5 @@
         } else {
             // We've got the bin size correct now
-            psTrace(__func__, 6, "*************: No more iteration.  sigma is %f\n", sigma);
+            psTrace("psLib.math", 6, "*************: No more iteration.  sigma is %f\n", sigma);
             iterate = -1;
         }
@@ -1347,8 +1347,8 @@
         psFree(cumulative);
         psFree(mask);
-        psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
         return false;
     }
-    psTrace(__func__, 6, "The 25-percent and 75-precent data point bins are (%d, %d).\n", binLo25, binHi25);
+    psTrace("psLib.math", 6, "The 25-percent and 75-precent data point bins are (%d, %d).\n", binLo25, binHi25);
 
     // ADD step 8: Interpolate to find these two positions exactly: these are the upper and lower quartile
@@ -1365,5 +1365,5 @@
         psFree(statsMinMax);
         psFree(mask);
-        psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s(1) end  ----\n", __func__);
         return false;
     }
@@ -1371,5 +1371,5 @@
     stats->robustLQ = binLo25F32;
     stats->robustUQ = binHi25F32;
-    psTrace(__func__, 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
+    psTrace("psLib.math", 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
             binLo25F32, binHi25F32);
     long N50 = 0;
@@ -1381,5 +1381,5 @@
     }
     stats->robustN50 = N50;
-    psTrace(__func__, 6, "The robustN50 is %d.\n", N50);
+    psTrace("psLib.math", 6, "The robustN50 is %d.\n", N50);
 
 
@@ -1405,5 +1405,5 @@
             psFree(statsMinMax);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1411,7 +1411,7 @@
         // Calculate the number of bins.
         long numBins = (max - min) / newBinSize;
-        psTrace(__func__, 6, "The new min/max values are (%f, %f).\n", min, max);
-        psTrace(__func__, 6, "The new bin size is %f.\n", newBinSize);
-        psTrace(__func__, 6, "The numBins is %d\n", numBins);
+        psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
+        psTrace("psLib.math", 6, "The new bin size is %f.\n", newBinSize);
+        psTrace("psLib.math", 6, "The numBins is %d\n", numBins);
 
         psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers)
@@ -1448,5 +1448,5 @@
             psFree(histogram);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1460,5 +1460,5 @@
             }
         }
-        psTrace(__func__, 6, "The peak bin is %d, with %f data.n", binNum, binMaxNums);
+        psTrace("psLib.math", 6, "The peak bin is %d, with %f data.n", binNum, binMaxNums);
 
         // Fit a Gaussian to the bins in the range 20 sigma of the robust histogram median.
@@ -1480,5 +1480,5 @@
             psFree(histogram);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1511,5 +1511,5 @@
             psFree(histogram);
             psFree(statsMinMax);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1537,5 +1537,5 @@
             psFree(params);
             psFree(mask);
-            psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
+            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
             return false;
         }
@@ -1546,10 +1546,10 @@
         // The fitted mean is the Gaussian mean.
         stats->fittedMean = params->data.F32[0];
-        psTrace(__func__, 6, "The fitted mean is %f.\n", params->data.F32[0]);
+        psTrace("psLib.math", 6, "The fitted mean is %f.\n", params->data.F32[0]);
 
         // The fitted standard deviation, SIGMA_r is determined by subtracting the smoothing scale in
         // quadrature: SIGMA_r^2 = SIGMA^2 - sigma_s^2
         stats->fittedStdev = sqrt(PS_SQR(params->data.F32[1]) - PS_SQR(newBinSize));
-        psTrace(__func__, 6, "The fitted stdev is %f.\n", stats->fittedStdev);
+        psTrace("psLib.math", 6, "The fitted stdev is %f.\n", stats->fittedStdev);
 
         // Clean up after fitting
@@ -1564,5 +1564,5 @@
     psFree(mask);
 
-    psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
     return true;
 }
@@ -1587,5 +1587,5 @@
 psStats* psStatsAlloc(psStatsOptions options)
 {
-    psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
     psStats* newStruct = NULL;
 
@@ -1616,5 +1616,5 @@
     newStruct->options = options;
 
-    psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
     return (newStruct);
 }
@@ -1645,6 +1645,6 @@
 psHistogram* psHistogramAlloc(float lower, float upper, int n)
 {
-    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
-    psTrace(__func__, 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
+    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
     PS_ASSERT_INT_POSITIVE(n, NULL);
     PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(upper, lower, NULL);
@@ -1678,5 +1678,5 @@
     newHist->uniform = true;
 
-    psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
     return newHist;
 }
@@ -1693,5 +1693,5 @@
 psHistogram* psHistogramAllocGeneric(const psVector* bounds)
 {
-    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
     PS_ASSERT_VECTOR_NON_NULL(bounds, NULL);
     PS_ASSERT_VECTOR_TYPE(bounds, PS_TYPE_F32, NULL);
@@ -1721,5 +1721,5 @@
     newHist->uniform = false;
 
-    psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
     return (newHist);
 }
@@ -1757,5 +1757,5 @@
                                )
 {
-    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
     PS_ASSERT_PTR_NON_NULL(out, false);
     PS_ASSERT_PTR_NON_NULL(out->bounds, false);
@@ -1794,5 +1794,5 @@
     if (boxcarLeftBinNum == boxcarRightBinNum) {
         out->nums->data.F32[binNum] += 1.0;
-        psTrace(__func__, 3, "---- %s(true) end  ----\n", __func__);
+        psTrace("psLib.math", 3, "---- %s(true) end  ----\n", __func__);
         return true;
     }
@@ -1813,5 +1813,5 @@
         (boxcarRight - out->bounds->data.F32[boxcarRightBinNum]) / boxcarWidth;
 
-    psTrace(__func__, 3, "---- %s(true) end  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s(true) end  ----\n", __func__);
     return true;
 }
@@ -1838,5 +1838,5 @@
                                psMaskType maskVal)
 {
-    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
     PS_ASSERT_PTR_NON_NULL(out, NULL);
     PS_ASSERT_VECTOR_NON_NULL(out->bounds, NULL);
@@ -1933,5 +1933,5 @@
     psFree(errorsF32);
 
-    psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
     return (out);
 }
@@ -1959,5 +1959,5 @@
     psMaskType maskVal)
 {
-    psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
+    psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
     PS_ASSERT_PTR_NON_NULL(stats, NULL);
     PS_ASSERT_VECTOR_NON_NULL(in, NULL);
@@ -2039,5 +2039,5 @@
             psFree(inF32);
             psFree(errorsF32);
-            psTrace(__func__, 3,"---- %s(NULL) end  ----\n", __func__);
+            psTrace("psLib.math", 3,"---- %s(NULL) end  ----\n", __func__);
             return(NULL);
         }
@@ -2063,5 +2063,5 @@
     psFree(errorsF32);
     psFree(maskU8);
-    psTrace(__func__, 3,"---- %s() end  ----\n", __func__);
+    psTrace("psLib.math", 3,"---- %s() end  ----\n", __func__);
     return (stats);
 }
