Index: trunk/psModules/test/imsubtract/tst_pmSubtractBias.c
===================================================================
--- trunk/psModules/test/imsubtract/tst_pmSubtractBias.c	(revision 5516)
+++ trunk/psModules/test/imsubtract/tst_pmSubtractBias.c	(revision 5552)
@@ -25,6 +25,6 @@
  *  XXX: Memory leaks are not being detected.
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-11-15 20:09:03 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-19 00:55:18 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -42,9 +42,9 @@
 static int test05(void);
 testDescription tests[] = {
-                              {test00a, 000, "doSubtractBiasFullFrame", 0, false},
-                              {test00b, 000, "doSubtractDarkFullFrame", 0, false},
+                              {test00a, 000, "doSubtractBiasFullFrame", 0, true},
+                              {test00b, 000, "doSubtractDarkFullFrame", 0, true},
                               //                              {test01, 000, "pmSubtractBias", 0, true},
                               //                              {test02, 000, "pmSubtractBias", 0, true},
-                              //                              {test03, 000, "pmSubtractBias", 0, false},
+                              //                              {test03, 000, "pmSubtractBias", 0, true},
                               //                              {test04, 000, "pmSubtractBias", 0, true},
                               {test05, 000, "pmSubtractBias", 0, false},
@@ -509,10 +509,44 @@
 */
 
+void PS_POLY1D_PRINT(
+    psPolynomial1D *poly)
+{
+    printf("-------------- PS_POLY1D_PRINT() --------------\n");
+    printf("poly->nX is %d\n", poly->nX);
+    for (psS32 i = 0 ; i < (1 + poly->nX) ; i++) {
+        printf("poly->coeff[%d] is %f\n", i, poly->coeff[i]);
+    }
+}
+
+void PS_PRINT_SPLINE2(psSpline1D *mySpline)
+{
+    printf("-------------- PS_PRINT_SPLINE2() --------------\n");
+    if (mySpline != NULL) {
+        printf("mySpline->n is %d\n", mySpline->n);
+        for (psS32 i = 0 ; i < mySpline->n ; i++) {
+            if (mySpline->spline[i] != NULL) {
+                PS_POLY1D_PRINT(mySpline->spline[i]);
+            }
+        }
+        if (mySpline->knots != NULL) {
+            PS_VECTOR_PRINT_F32(mySpline->knots);
+        }
+    } else {
+        printf("NULL\n");
+    }
+    printf("-------------- PS_PRINT_SPLINE2() DONE --------------\n");
+}
+
+
+
+
+
+
 /******************************************************************************
-doSubtractFullOverscanColumnsGeneric(): This is a general version of the
+doSubtractOverscansGeneric(): This is a general version of the
 bias subtraction tests which allows the various parameters to be specified
 as arguments.
  *****************************************************************************/
-int doSubtractFullOverscanColumnsGeneric(
+int doSubtractOverscansGeneric(
     int imageNumCols,
     int imageNumRows,
@@ -531,5 +565,5 @@
 
     printPositiveTestHeader(stdout, "pmSubtractBias", "PUT COMMENT HERE");
-    printf("---- doSubtractFullOverscanColumnsGeneric() ----\n");
+    printf("---- doSubtractOverscansGeneric() ----\n");
     printf("    Image size: %d by %d\n", imageNumRows, imageNumCols);
     printf("    Overscan size: %d by %d\n", overscanNumRows, overscanNumCols);
@@ -636,4 +670,5 @@
                                    stat, nBin, NULL, NULL);
     } else if (fit == PM_FIT_SPLINE) {
+        //        mySpline = psSpline1DAlloc();
         myReadout = pmSubtractBias(myReadout, mySpline, PM_FIT_SPLINE, overscanaxis,
                                    stat, nBin, NULL, NULL);
@@ -652,13 +687,16 @@
         }
     }
+    // XXX: Figure out memory deallocation
     psFree(fpa);
-    psFree(chip);
-    psFree(cell);
-    psListElem *tmpElem = (psListElem *) myReadout->bias->head;
-    while (NULL != tmpElem) {
-        psFree((psImage *) tmpElem->data);
-        tmpElem = tmpElem->next;
-    }
-    psFree(myReadout);
+    //    psFree(chip);
+    //    psFree(cell);
+    /*
+        psListElem *tmpElem = (psListElem *) myReadout->bias->head;
+        while (NULL != tmpElem) {
+            psFree((psImage *) tmpElem->data);
+            tmpElem = tmpElem->next;
+        }
+        psFree(myReadout);
+    */
     psFree(camera);
     psFree(stat);
@@ -722,15 +760,15 @@
     // Overscan images are same size, no fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_NONE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_NONE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -740,15 +778,15 @@
     // Overscan images are same size, no fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_NONE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_NONE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -790,15 +828,15 @@
     // Overscan images are too small, spline fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -808,15 +846,15 @@
     // Overscan images are too small, spline fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -827,15 +865,15 @@
     // Overscan images are same size, spline fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -845,15 +883,15 @@
     // Overscan images are same size, spline fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -863,15 +901,15 @@
     // Overscan images are too big, spline fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -881,15 +919,15 @@
     // Overscan images are too big, spline fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2 , NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -900,15 +938,15 @@
     // A single overscan image of the same size, spline fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_ALL,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_SPLINE, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_ROWS,
@@ -919,15 +957,15 @@
     // Overscan images are too small, polynomial fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -937,15 +975,15 @@
     // Overscan images are too small, polynomial fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols-2, overscanNumRows-2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -956,15 +994,15 @@
     // Overscan images are same size, polynomial fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -974,15 +1012,15 @@
     // Overscan images are same size, polynomial fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -992,15 +1030,15 @@
     // Overscan images are too big, polynomial fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -1010,15 +1048,15 @@
     // Overscan images are too big, polynomial fit, bin factor is 2.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 2);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols+2, overscanNumRows+2, NUM_OVERSCANS,
                   PM_OVERSCAN_ROWS,
@@ -1028,15 +1066,15 @@
     // A single overscan image of the same size, polynomial fit, bin factor is 1.
     //
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_ALL,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_COLUMNS,
                   PM_FIT_POLYNOMIAL, 1);
 
-    testStatus |= doSubtractFullOverscanColumnsGeneric(imageNumCols, imageNumRows,
+    testStatus |= doSubtractOverscansGeneric(imageNumCols, imageNumRows,
                   overscanNumCols, overscanNumRows, 1,
                   PM_OVERSCAN_ROWS,
@@ -1062,5 +1100,5 @@
 {
     int testStatus = 0;
-    testStatus = test05a(NUM_COLS, NUM_ROWS, NUM_COLS, NUM_ROWS);
+    //    testStatus = test05a(NUM_COLS, NUM_ROWS, NUM_COLS, NUM_ROWS);
 
     //    testStatus|= test05b(LOW_COLS, LOW_ROWS, LOW_COLS, LOW_ROWS);
@@ -1089,2 +1127,3 @@
 
 
+// This code will
