Index: trunk/psLib/src/math/psMinimizePolyFit.c
===================================================================
--- trunk/psLib/src/math/psMinimizePolyFit.c	(revision 7766)
+++ trunk/psLib/src/math/psMinimizePolyFit.c	(revision 8245)
@@ -10,6 +10,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-30 02:20:06 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-09 02:26:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -470,5 +470,5 @@
     const psVector *x)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
     PS_ASSERT_VECTOR_NON_NULL(f, NULL);
@@ -488,16 +488,16 @@
 
     if (psTraceGetLevel(__func__) >= 6) {
-        psTrace(__func__, 6, "VectorFitPolynomial1D()\n");
+        psTrace("psLib.math", 6, "VectorFitPolynomial1D()\n");
         for (psS32 i = 0; i < f->n; i++) {
-            psTrace(__func__, 6, "(x, f, fErr) is (");
+            psTrace("psLib.math", 6, "(x, f, fErr) is (");
             if (x != NULL) {
-                psTrace(__func__, 6, "%f, %f, ", x->data.F64[i], f->data.F64[i]);
+                psTrace("psLib.math", 6, "%f, %f, ", x->data.F64[i], f->data.F64[i]);
             } else {
-                psTrace(__func__, 6, "%f, %f, ", (psF64) i, f->data.F64[i]);
+                psTrace("psLib.math", 6, "%f, %f, ", (psF64) i, f->data.F64[i]);
             }
             if (fErr != NULL) {
-                psTrace(__func__, 6, "%f)\n", fErr->data.F64[i]);
+                psTrace("psLib.math", 6, "%f)\n", fErr->data.F64[i]);
             } else {
-                psTrace(__func__, 6, "NULL)\n");
+                psTrace("psLib.math", 6, "NULL)\n");
             }
         }
@@ -516,5 +516,5 @@
         psFree(A);
         psFree(B);
-        psTrace(__func__, 4, "---- %s() End ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
         return(NULL);
     }
@@ -645,5 +645,5 @@
     psFree(B);
 
-    psTrace(__func__, 4, "---- %s() End ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
     return (myPoly);
 }
@@ -754,5 +754,5 @@
     const psVector *xIn)
 {
-    psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(poly, NULL);
     PS_ASSERT_PTR_NON_NULL(stats, NULL);
@@ -811,15 +811,15 @@
     // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
     stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
-    psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
-    psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
+    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
+    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
 
     //
     for (psS32 N = 0; N < stats->clipIter; N++) {
-        psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
+        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
         psS32 Nkeep = 0;
         if (psTraceGetLevel(__func__) >= 6) {
             if (mask != NULL) {
                 for (psS32 i = 0 ; i < mask->n ; i++) {
-                    psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
+                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
                 }
             }
@@ -851,5 +851,5 @@
                 for (psS32 i = 0 ; i < mask->n ; i++) {
                     if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
-                        psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
+                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
                                 i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
                     }
@@ -859,6 +859,6 @@
 
         stats  = psVectorStats(stats, resid, NULL, mask, maskValue);
-        psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
-        psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
+        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
+        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
         psF32 minClipValue = -minClipSigma*stats->sampleStdev;
         psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
@@ -875,8 +875,8 @@
                     (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
                 if (f->type.type == PS_TYPE_F64) {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F64[i], i, resid->data.F64[i]);
                 } else {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F32[i], i, resid->data.F64[i]);
                 }
@@ -894,5 +894,5 @@
         // since the polynomial fit won't change.
         //
-        psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
+        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
         psFree(fit);
     }
@@ -905,5 +905,5 @@
     psFree(resid);
 
-    psTrace(__func__, 3, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
     return (poly);
 }
@@ -931,5 +931,5 @@
     const psVector *y)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
     PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
@@ -967,5 +967,5 @@
         psFree(A);
         psFree(B);
-        psTrace(__func__, 4, "---- %s() End ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
         return(NULL);
     }
@@ -1045,5 +1045,5 @@
     psFree(B);
 
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     return (myPoly);
 }
@@ -1201,5 +1201,5 @@
     const psVector *y)
 {
-    psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(poly, NULL);
     PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
@@ -1246,14 +1246,14 @@
     // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
     stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
-    psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
-    psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
+    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
+    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
 
     for (psS32 N = 0; N < stats->clipIter; N++) {
-        psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
+        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
         psS32 Nkeep = 0;
         if (psTraceGetLevel(__func__) >= 6) {
             if (mask != NULL) {
                 for (psS32 i = 0 ; i < mask->n ; i++) {
-                    psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
+                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
                 }
             }
@@ -1286,5 +1286,5 @@
                 for (psS32 i = 0 ; i < mask->n ; i++) {
                     if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
-                        psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
+                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
                                 i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
                     }
@@ -1300,6 +1300,6 @@
             return(NULL);
         }
-        psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
-        psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
+        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
+        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
         psF32 minClipValue = -minClipSigma*stats->sampleStdev;
         psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
@@ -1316,8 +1316,8 @@
                     (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
                 if (fit->type.type == PS_TYPE_F64) {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F64[i], i, resid->data.F64[i]);
                 } else {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F32[i], i, resid->data.F64[i]);
                 }
@@ -1331,5 +1331,5 @@
         }
 
-        psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
+        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
         psFree(fit);
     }
@@ -1342,5 +1342,5 @@
     }
 
-    psTrace(__func__, 3, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
     return(poly);
 }
@@ -1369,5 +1369,5 @@
     const psVector *z)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
     PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
@@ -1411,5 +1411,5 @@
         psFree(A);
         psFree(B);
-        psTrace(__func__, 4, "---- %s() End ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
         return(NULL);
     }
@@ -1543,5 +1543,5 @@
     psFree(B);
 
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     return (myPoly);
 }
@@ -1716,5 +1716,5 @@
     const psVector *z)
 {
-    psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(poly, NULL);
     PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
@@ -1766,14 +1766,14 @@
     // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
     stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
-    psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
-    psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
+    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
+    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
 
     for (psS32 N = 0; N < stats->clipIter; N++) {
-        psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
+        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
         psS32 Nkeep = 0;
         if (psTraceGetLevel(__func__) >= 6) {
             if (mask != NULL) {
                 for (psS32 i = 0 ; i < mask->n ; i++) {
-                    psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
+                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
                 }
             }
@@ -1805,5 +1805,5 @@
                 for (psS32 i = 0 ; i < mask->n ; i++) {
                     if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
-                        psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
+                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
                                 i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
                     }
@@ -1820,6 +1820,6 @@
         }
 
-        psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
-        psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
+        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
+        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
         psF32 minClipValue = -minClipSigma*stats->sampleStdev;
         psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
@@ -1836,8 +1836,8 @@
                     (resid->data.F64[i] - stats->sampleMedian < minClipValue))  {
                 if (f->type.type == PS_TYPE_F64) {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F64[i], i, resid->data.F64[i]);
                 } else {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F32[i], i, resid->data.F64[i]);
                 }
@@ -1851,5 +1851,5 @@
         }
 
-        psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
+        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
         psFree(fit);
     }
@@ -1862,5 +1862,5 @@
     }
 
-    psTrace(__func__, 3, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
     return(poly);
 }
@@ -1888,5 +1888,5 @@
     const psVector *t)
 {
-    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
     PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
@@ -1934,5 +1934,5 @@
         psFree(A);
         psFree(B);
-        psTrace(__func__, 4, "---- %s() End ----\n", __func__);
+        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
         return(NULL);
     }
@@ -2079,5 +2079,5 @@
     psFree(B);
 
-    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     return (myPoly);
 }
@@ -2277,5 +2277,5 @@
     const psVector *t)
 {
-    psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
     PS_ASSERT_POLY_NON_NULL(poly, NULL);
     PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
@@ -2331,14 +2331,14 @@
     // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
     stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
-    psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
-    psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
+    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
+    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
 
     for (psS32 N = 0; N < stats->clipIter; N++) {
-        psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial4D()\n");
+        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial4D()\n");
         psS32 Nkeep = 0;
         if (psTraceGetLevel(__func__) >= 6) {
             if (mask != NULL) {
                 for (psS32 i = 0 ; i < mask->n ; i++) {
-                    psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
+                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
                 }
             }
@@ -2371,5 +2371,5 @@
                 for (psS32 i = 0 ; i < mask->n ; i++) {
                     if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
-                        psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
+                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
                                 i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
                     }
@@ -2385,6 +2385,6 @@
             return(NULL);
         }
-        psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
-        psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
+        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
+        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
         psF32 minClipValue = -minClipSigma*stats->sampleStdev;
         psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
@@ -2401,8 +2401,8 @@
                     (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
                 if (f->type.type == PS_TYPE_F64) {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F64[i], i, resid->data.F64[i]);
                 } else {
-                    psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
+                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
                             i, fit->data.F32[i], i, resid->data.F64[i]);
                 }
@@ -2417,5 +2417,5 @@
         }
 
-        psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
+        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
         psFree (fit);
     }
@@ -2428,5 +2428,5 @@
     }
 
-    psTrace(__func__, 3, "---- %s() end ----\n", __func__);
+    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
     return(poly);
 }
