Index: /trunk/psModules/test/Makefile.am
===================================================================
--- /trunk/psModules/test/Makefile.am	(revision 5168)
+++ /trunk/psModules/test/Makefile.am	(revision 5169)
@@ -1,38 +1,14 @@
 # Makefile for psModule tests
 
-AM_LDFLAGS = $(top_builddir)/src/libpsmodule.la $(PSMODULE_LIBS)
-AM_CFLAGS  = @AM_CFLAGS@ -I$(top_srcdir)/src $(PSMODULE_CFLAGS)
+SUBDIRS = $(SRCDIRS)
 
-TESTS = tst_pmFlatField \
-	tst_pmMaskBadPixels \
-	tst_pmNonLinear \
-	tst_pmSubtractBias \
-	tst_pmReadoutCombine \
-	tst_pmSubtractSky \
-	tst_pmImageSubtract \
-	tst_pmImageCombine \
-	tst_pmObjects01 \
-	tst_pmAstrometry
+EXTRA_DIST = runTest FullUnitTest
 
-check_PROGRAMS = $(TESTS)
+all:
+	chmod a+x FullUnitTest
 
-TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+test: check
 
 tests: $(TESTS)
 
-EXTRA_DIST = runTest verified
-
-CLEANFILES = $(TESTS) temp/*
-
-tst_pmFlatField_SOURCES = tst_pmFlatField.c
-tst_pmMaskBadPixels_SOURCES = tst_pmMaskBadPixels.c
-tst_pmNonLinear_SOURCES = tst_pmNonLinear.c
-tst_pmSubtractBias_SOURCES = tst_pmSubtractBias.c
-tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c
-tst_pmSubtractSky_SOURCES = tst_pmSubtractSky.c
-tst_pmImageSubtract_SOURCES = tst_pmImageSubtract.c
-tst_pmImageCombine_SOURCES = tst_pmImageCombine.c
-tst_pmObjects01_SOURCES = tst_pmObjects01.c
-tst_pmAstrometry_SOURCES = tst_pmAstrometry.c
-
-test: check
+CLEANFILES = $(TESTS)
Index: /trunk/psModules/test/astrom/Makefile.am
===================================================================
--- /trunk/psModules/test/astrom/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/astrom/Makefile.am	(revision 5169)
@@ -0,0 +1,22 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+AM_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS)
+
+TESTS = \
+    tst_pmAstrometry
+
+tst_pmAstrometry_SOURCES = tst_pmAstrometry.c
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/astrom/tst_pmAstrometry.c
===================================================================
--- /trunk/psModules/test/astrom/tst_pmAstrometry.c	(revision 5169)
+++ /trunk/psModules/test/astrom/tst_pmAstrometry.c	(revision 5169)
@@ -0,0 +1,363 @@
+/** @file  tst_pmAstrometry.c
+ *
+ *  @brief Contains the tests for pmAstrometry.[ch].  Only the pmxxxAlloc()
+ *  and psFree() functionality are used here.
+ *
+ *  @author George Gusciora, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:51 $
+ *
+ *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#include "config.h"
+#include <math.h>
+#include <string.h>
+#include "psTest.h"
+#include "pslib_strict.h"
+#include "pmAstrometry.h"
+
+static psS32 testFPAAlloc(void);
+static psS32 testChipAlloc(void);
+static psS32 testCellAlloc(void);
+static psS32 testReadoutAlloc(void);
+
+testDescription tests[] = {
+                              {testFPAAlloc,739,"pmFPAAlloc",0,false},
+                              {testChipAlloc,740,"pmChipAlloc",0,false},
+                              {testCellAlloc,741,"pmCellAlloc",0,false},
+                              {testReadoutAlloc,742,"pmReadoutAlloc",0,false},
+                              {NULL}
+                          };
+
+psS32 main(psS32 argc, char* argv[])
+{
+    psLogSetLevel(PS_LOG_INFO);
+    psLogSetFormat("HLNM");
+
+    return ! runTestSuite(stderr,"pmAstrometry",tests,argc,argv);
+}
+
+static psS32 testFPAAlloc(void)
+{
+    // XXX: Do something more with these arguments.
+    const psMetadata *camera = psMetadataAlloc();
+    psDB *db = NULL;
+    pmFPA* fpa = pmFPAAlloc(camera, db);
+
+    if (fpa == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc returned a NULL.");
+        return 1;
+    }
+
+    if (fpa->fromTangentPlane != NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->fromTangentPlane to NULL.");
+        return 2;
+    }
+
+    if (fpa->toTangentPlane != NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->toTangentPlane to NULL.");
+        return 3;
+    }
+    if (fpa->projection != NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->projection to NULL.");
+        return 4;
+    }
+
+    if (fpa->concepts == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->concepts.");
+        return 5;
+    }
+
+    if (fpa->analysis == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->analysis.");
+        return 6;
+    }
+
+    if (fpa->camera != camera) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->camera.");
+        return 7;
+    }
+
+    if (fpa->chips == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->chips.");
+        return 8;
+    }
+
+    if (fpa->header != NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->header to NULL.");
+        return 9;
+    }
+
+    if (fpa->db != db) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc did not set ->db.");
+        return 10;
+    }
+
+    psFree(camera);
+    psFree(fpa);
+
+    return 0;
+}
+
+static psS32 testChipAlloc(void)
+{
+    const psMetadata *camera = psMetadataAlloc();
+    psDB *db = NULL;
+    pmFPA* fpa = pmFPAAlloc(camera, db);
+    if (fpa == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc returned a NULL.");
+        return 1;
+    }
+
+    pmChip *chip = pmChipAlloc(fpa);
+    if (chip == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmChipAlloc returned a NULL.");
+        return 1;
+    }
+
+    if (chip->col0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->col0 set improperly.\n");
+        return 5;
+    }
+
+    if (chip->row0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->row0 set improperly.\n");
+        return 6;
+    }
+
+    if (chip->toFPA != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->toChip set improperly.\n");
+        return 7;
+    }
+
+    if (chip->fromFPA != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->toFPA set improperly.\n");
+        return 8;
+    }
+
+    if (chip->concepts == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->concepts set improperly.\n");
+        return 21;
+    }
+
+    if (chip->analysis == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->analysis set improperly.\n");
+        return 10;
+    }
+
+    if (chip->cells == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->cells set improperly.\n");
+        return 22;
+    }
+
+    if (chip->parent != fpa) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->parent set improperly.\n");
+        return 23;
+    }
+
+    if (chip->valid != false) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->valid set improperly.\n");
+        return 24;
+    }
+
+    if (chip->extname != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->extname set improperly.\n");
+        return 25;
+    }
+
+    if (chip->pixels != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->pixels set improperly.\n");
+        return 26;
+    }
+
+    if (chip->header != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "chip->header set improperly.\n");
+        return 27;
+    }
+
+    psFree(fpa);
+    psFree(chip);
+    psFree(camera);
+
+    return 0;
+}
+
+static psS32 testCellAlloc(void)
+{
+    psDB *db = NULL;
+    const psMetadata *camera = psMetadataAlloc();
+    pmFPA* fpa = pmFPAAlloc(camera, db);
+    if (fpa == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc returned a NULL.n");
+        return 1;
+    }
+
+    pmChip *chip = pmChipAlloc(fpa);
+    if (chip == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmChipAlloc returned a NULL.n");
+        return 2;
+    }
+
+    pmCell *cell = pmCellAlloc(chip);
+    if (cell == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmCellAlloc returned a NULL.n");
+        return 3;
+    }
+
+    if (cell->col0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->col0 set improperly.\n");
+        return 5;
+    }
+
+    if (cell->row0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->row0 set improperly.\n");
+        return 6;
+    }
+
+    if (cell->toChip != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->toChip set improperly.\n");
+        return 7;
+    }
+
+    if (cell->toFPA != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->toFPA set improperly.\n");
+        return 8;
+    }
+
+    if (cell->toSky != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->toSky set improperly.\n");
+        return 9;
+    }
+
+    if (cell->analysis == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->analysis set improperly.\n");
+        return 10;
+    }
+
+    if (cell->concepts == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->concepts set improperly.\n");
+        return 21;
+    }
+
+    if (cell->readouts == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->readouts set improperly.\n");
+        return 22;
+    }
+
+    if (cell->parent != chip) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->parent set improperly.\n");
+        return 23;
+    }
+
+    if (cell->valid != false) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->valid set improperly.\n");
+        return 24;
+    }
+
+    if (cell->extname != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->extname set improperly.\n");
+        return 25;
+    }
+
+    if (cell->pixels != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->pixels set improperly.\n");
+        return 26;
+    }
+
+    if (cell->header != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "cell->header set improperly.\n");
+        return 27;
+    }
+
+    psFree(fpa);
+    psFree(chip);
+    psFree(cell);
+    psFree(camera);
+
+    return 0;
+}
+
+static psS32 testReadoutAlloc(void)
+{
+    psDB *db = NULL;
+    const psMetadata *camera = psMetadataAlloc();
+    pmFPA* fpa = pmFPAAlloc(camera, db);
+
+    if (fpa == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmFPAAlloc returned a NULL.\n");
+        return 1;
+    }
+
+    pmChip *chip = pmChipAlloc(fpa);
+    if (chip == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmChipAlloc returned a NULL.\n");
+        return 2;
+    }
+
+    pmCell *cell = pmCellAlloc(chip);
+    if (cell == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmCellAlloc returned a NULL.\n");
+        return 3;
+    }
+
+    pmReadout *readout = pmReadoutAlloc(cell);
+    if (readout == NULL) {
+        psLogMsg(__func__,PS_LOG_ERROR, "pmReadoutAlloc returned a NULL.\n");
+        return 4;
+    }
+
+    if (readout->col0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->col0 set improperly.\n");
+        return 5;
+    }
+
+    if (readout->row0 != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->row0 set improperly.\n");
+        return 6;
+    }
+
+    if (readout->colBins != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->colBins set improperly.\n");
+        return 7;
+    }
+
+    if (readout->rowBins != -1) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->colBins set improperly.\n");
+        return 8;
+    }
+
+    if (readout->image != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->image set improperly.\n");
+        return 9;
+    }
+
+    if (readout->mask != NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->mask set improperly.\n");
+        return 10;
+    }
+
+    if (readout->analysis == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->analysis set improperly.\n");
+        return 11;
+    }
+
+    if (readout->concepts == NULL) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->concepts set improperly.\n");
+        return 12;
+    }
+
+    if (readout->parent != cell) {
+        psLogMsg(__func__, PS_LOG_ERROR, "pmReadout->parent set improperly.\n");
+        return 15;
+    }
+
+    psFree(fpa);
+    psFree(chip);
+    psFree(cell);
+    psFree(readout);
+    psFree(camera);
+
+    return 0;
+}
Index: /trunk/psModules/test/camera/Makefile.am
===================================================================
--- /trunk/psModules/test/camera/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/camera/Makefile.am	(revision 5169)
@@ -0,0 +1,18 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+
+TESTS =
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/config/Makefile.am
===================================================================
--- /trunk/psModules/test/config/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/config/Makefile.am	(revision 5169)
@@ -0,0 +1,14 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+
+TESTS =
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests:
+
+test: check
Index: /trunk/psModules/test/detrend/Makefile.am
===================================================================
--- /trunk/psModules/test/detrend/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/detrend/Makefile.am	(revision 5169)
@@ -0,0 +1,26 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+AM_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS)
+
+TESTS = \
+    tst_pmFlatField \
+    tst_pmMaskBadPixels \
+    tst_pmNonLinear
+
+tst_pmFlatField_SOURCES = tst_pmFlatField.c
+tst_pmMaskBadPixels_SOURCES = tst_pmMaskBadPixels.c
+tst_pmNonLinear_SOURCES = tst_pmNonLinear.c
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/detrend/tst_pmFlatField.c
===================================================================
--- /trunk/psModules/test/detrend/tst_pmFlatField.c	(revision 5169)
+++ /trunk/psModules/test/detrend/tst_pmFlatField.c	(revision 5169)
@@ -0,0 +1,298 @@
+/** @file tst_pmFlatField.c
+ *
+ *  @brief Contains the tests for pmFlatField.c:
+ *
+ *    Test A - Divide input image by flat image
+ *    Test B - Mask flat image data
+ *    Test C - Mask flat image data starting with non-null mask
+ *    Test E - Attempt to use null input image
+ *    Test F - Attempt tp use null flat image
+ *    Test G - Attempt to use input image bigger than flat image
+ *    Test H - Attempt to use input image mask bigger than flat image
+ *    Test I - Attempt to use offset greater than input image
+ *    Test J - Attempt to use complex input image
+ *    Test K - Attempt to use complex flat image
+ *    Test L - Attempt to use non-equal input and flat image types
+ *    Test M - Attempt to use non-mask type mask image
+ *
+ * XXX: Added a mask argument to pmFlatField().  Must add tests.  For now, all
+ * masks are NULL.
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmFlatField.h"
+
+
+#define PRINT_MATRIX(IMAGE,TYPE,STRING)                                                                      \
+printf(STRING);                                                                                              \
+printf("\n");                                                                                                \
+for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
+    for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
+        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
+            printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
+        } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
+            printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                      \
+        } else {                                                                                             \
+            printf("%f ", (double)IMAGE->data.TYPE[i][j]);                                                   \
+        }                                                                                                    \
+    }                                                                                                        \
+    printf("\n");                                                                                            \
+}                                                                                                            \
+printf("\n");
+
+
+#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
+psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
+for(int i=0; i<NAME->numRows; i++) {                                                                         \
+    for(int j=0; j<NAME->numCols; j++) {                                                                     \
+        NAME->data.TYPE[i][j] = VALUE;                                                                       \
+    }                                                                                                        \
+}
+
+
+static int testFlatField(void);
+
+
+testDescription tests[] = {
+                              {testFlatField, 753, "pmFlatField", 0, false},
+                              {NULL}
+                          };
+
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+
+int testFlatField( void )
+{
+    // Test A - Divide input image by flat image
+    printPositiveTestHeader(stdout, "pmFlatField", "Test A - Divide input image by flat image");
+    CREATE_AND_SET_IMAGE(inImage,F64,6.0,3,3)
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    inReadout->image = inImage;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+    PRINT_MATRIX(inImage,F64,"Input image:");
+
+    CREATE_AND_SET_IMAGE(inMask,U8,0,3,3)
+    pmReadout *inMaskReadout = pmReadoutAlloc(NULL);
+    inMaskReadout->image = inMask;
+    inMaskReadout->row0 = 0;
+    inMaskReadout->col0 = 0;
+    PRINT_MATRIX(inMask,U8,"Input mask:");
+
+    CREATE_AND_SET_IMAGE(flatImage1,F64,2.0,3,3)
+    pmReadout *flatReadout = pmReadoutAlloc(NULL);
+    flatReadout->row0 = 0;
+    flatReadout->col0 = 0;
+    flatReadout->image = flatImage1;
+    PRINT_MATRIX(flatImage1,F64,"Flat image:");
+
+    if ( !pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test A - Returned false should be true");
+        return 1;
+    }
+    PRINT_MATRIX(inImage,F64, "Resulting image:");
+    printFooter(stdout, "pmFlatField", "Test A - Divide input image by flat image", true);
+    printf("\n\n\n");
+
+
+    // Test B - Mask flat image data
+    printPositiveTestHeader(stdout, "pmFlatField", "Test B - Mask flat image data");
+    PRINT_MATRIX(inImage, F64, "Input image:");
+    CREATE_AND_SET_IMAGE(flatImage2,F64,0.0,3,3)
+    PRINT_MATRIX(flatImage2, F64, "Flat image:");
+    flatReadout->image = flatImage2;
+    if ( !pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test B - Returned false should be true");
+        return 2;
+    }
+    PRINT_MATRIX(inMaskReadout->image, PS_TYPE_MASK_DATA, "Resulting mask:");
+    PRINT_MATRIX(inImage,F64,"Resulting image:");
+    printFooter(stdout, "pmFlatField", "Test B - Mask flat image data", true);
+    printf("\n\n\n");
+
+
+    // Test C - Mask flat image data starting with non-null mask
+    printPositiveTestHeader(stdout, "pmFlatField", "Test C - Mask flat image data starting with non-null mask");
+    PRINT_MATRIX(inImage, F64, "Input image:");
+    flatImage2->data.F64[0][0] = 3.0;
+    flatImage2->data.F64[0][1] = -3.0;
+    PRINT_MATRIX(flatImage2, F64, "Flat image:");
+    CREATE_AND_SET_IMAGE(mask1,U8,0,3,3);
+    psFree(inReadout->mask);
+    inReadout->mask = mask1;
+    if ( !pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test C - Returned false should be true");
+        return 3;
+    }
+    PRINT_MATRIX(flatImage2, F64, "Flat image out:");
+    PRINT_MATRIX(inReadout->mask, PS_TYPE_MASK_DATA,"Resulting mask:");
+    PRINT_MATRIX(inImage,F64,"Resulting image:");
+    printFooter(stdout, "pmFlatField", "Test C - Mask flat image data starting with non-null mask", true);
+    printf("\n\n\n");
+
+
+    // Test D - Attempt to use null flat readout
+    printNegativeTestHeader(stdout,"pmFlatField", "Test D - Attempt to use null flat readout",
+                            "Null not allowed for flat readout", 0);
+    if( pmFlatField(inReadout, inMaskReadout, NULL) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test D - Returned true should be false");
+        return 4;
+    }
+    printFooter(stdout, "pmFlatField", "Test D - Attempt to use null flat readout", true);
+    printf("\n\n\n");
+
+
+    // Test E - Attempt to use null input image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test E - Attempt to use null input image",
+                            "Null not allowed for input image", 0);
+    psImage *temp = inReadout->image;
+    inReadout->image = NULL;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test E - Returned true should be false" );
+        return 5;
+    }
+    inReadout->image = temp;
+    printFooter(stdout, "pmFlatField", "Test E - Attempt to use null input image", true);
+    printf("\n\n\n");
+
+
+    // Test F - Attempt tp use null flat image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test F - Attempt tp use null flat image",
+                            "Null not allowed for flat image", 0);
+    temp = flatReadout->image;
+    flatReadout->image = NULL;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test F - Returned true should be false" );
+        return 6;
+    }
+    flatReadout->image = temp;
+    printFooter(stdout, "pmFlatField", "Test F - Attempt tp use null flat image", true);
+    printf("\n\n\n");
+
+
+    // Test G - Attempt to use input image bigger than flat image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test G - Attempt to use input image bigger than flat image",
+                            "Input image size exceeds that of flat image", 0);
+    CREATE_AND_SET_IMAGE(smallFlat,F64,0.0,2,2);
+    temp = flatReadout->image;
+    flatReadout->image = smallFlat;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test G - Returned true should be false");
+        return 7;
+    }
+    flatReadout->image = temp;
+    printFooter(stdout, "pmFlatField", "Test G - Attempt to use input image bigger than flat image", true);
+    printf("\n\n\n");
+
+
+    // Test H - Attempt to use input image mask bigger than flat image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test H - Attempt to use input image mask bigger than flat image",
+                            "Input image mask size exceeds that of flat image", 0);
+    CREATE_AND_SET_IMAGE(largeMask,F64,0.0,5,5);
+    temp = inReadout->mask;
+    inMaskReadout->image = largeMask;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test H - Returned true should be false");
+        return 8;
+    }
+    inReadout->mask = temp;
+    printFooter(stdout, "pmFlatField", "Test H - Attempt to use input image mask bigger than flat image", true);
+    printf("\n\n\n");
+
+
+    // Test I - Attempt to use offset greater than input image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test I - Attempt to use offset greater than input image",
+                            "Total offset >= input image size", 0);
+    *(int*)&inReadout->col0 = 50;
+    *(int*)&inReadout->row0 = 50;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test I - Returned true should be false");
+        return 9;
+    }
+    *(int*)&inReadout->col0 = 0;
+    *(int*)&inReadout->row0 = 0;
+    printFooter(stdout, "pmFlatField", "Test I - Attempt to use offset greater than input image", true);
+    printf("\n\n\n");
+
+
+    // Test J - Attempt to use complex input image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test J - Attempt to use complex input image",
+                            "Complex types not allowed for input image", 0);
+    *(psElemType* ) & inReadout->image->type.type = PS_TYPE_C64;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test J - Returned true should be false");
+        return 10;
+    }
+    *(psElemType* ) & inReadout->image->type.type = PS_TYPE_F64;
+    printFooter(stdout, "pmFlatField", "Test J - Attempt to use complex input image", true);
+    printf("\n\n\n");
+
+
+    // Test K - Attempt to use complex flat image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test K - Attempt to use complex flat image",
+                            "Complex types not allowed for flat image", 0);
+    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_C64;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test K - Returned ture should be false");
+        return 11;
+    }
+    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F64;
+    printFooter(stdout, "pmFlatField", "Test K - Attempt to use complex flat image", true);
+    printf("\n\n\n");
+
+
+    // Test L - Attempt to use non-equal input and flat image types
+    printNegativeTestHeader(stdout,"pmFlatField", "Test L - Attempt to use non-equal input and flat image types",
+                            "Input and flat image types differ", 0);
+    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F32;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test L - Returned true should be false");
+        return 12;
+    }
+    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F64;
+    printFooter(stdout, "pmFlatField", "Test L - Attempt to use non-equal input and flat image types", true);
+    printf("\n\n\n");
+
+
+    // Test M - Attempt to use non-mask type mask image
+    printNegativeTestHeader(stdout,"pmFlatField", "Test M - Attempt to use non-mask type mask image",
+                            "Mask must be PS_TYPE_MASK type", 0);
+    *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_F32;
+    if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) {
+        psError(PS_ERR_UNKNOWN,true,"Test M - Returned true should be false");
+        return 13;
+    }
+    *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_MASK;
+    printFooter(stdout, "pmFlatField", "Test M - Attempt to use non-mask type mask image", true);
+    printf("\n\n\n");
+
+
+    // Free memory
+    psFree(inMask);
+    psFree(largeMask);
+    inMaskReadout->image = NULL;
+    psFree(inMaskReadout);
+    psFree(inReadout);
+    psFree(flatReadout);
+    //psFree(inImage);
+    psFree(flatImage1);
+    //psFree(flatImage1);
+    psFree(smallFlat);
+
+    return 0;
+}
+
Index: /trunk/psModules/test/detrend/tst_pmMaskBadPixels.c
===================================================================
--- /trunk/psModules/test/detrend/tst_pmMaskBadPixels.c	(revision 5169)
+++ /trunk/psModules/test/detrend/tst_pmMaskBadPixels.c	(revision 5169)
@@ -0,0 +1,303 @@
+/** @file tst_pmMaskBadPixels.c
+ *
+ *  @brief Contains the tests for pmMaskBadPixels:
+ *
+ *    Test A - Create mask based on maskVal argument
+ *    Test B - Create mask based on saturation argument
+ *    Test C - Create mask based on growVal and grow arguments
+ *    Test D - Auto Create mask based on maskVal argument
+ *    Test E - Attempt to use null mask
+ *    Test F - Attempt tp use null input image
+ *    Test G - Attempt to use input image bigger than mask
+ *    Test H - Attempt to use input image mask bigger than mask
+ *    Test I - Attempt to use offset greater than input image
+ *    Test J - Attempt to use complex input image
+ *    Test K - Attempt to use non-mask type mask image
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmMaskBadPixels.h"
+
+
+#define PRINT_MATRIX(IMAGE,TYPE,STRING)                                                                      \
+printf(STRING);                                                                                              \
+printf("\n");                                                                                                \
+for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
+    for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
+        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
+            printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
+        } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
+            printf("%d", (int)IMAGE->data.TYPE[i][j]);                                                       \
+        } else {                                                                                             \
+            printf("%f", (double)IMAGE->data.TYPE[i][j]);                                                    \
+        }                                                                                                    \
+    }                                                                                                        \
+    printf("\n");                                                                                            \
+}                                                                                                            \
+printf("\n");
+
+
+#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
+psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
+for(int i=0; i<NAME->numRows; i++) {                                                                         \
+    for(int j=0; j<NAME->numCols; j++) {                                                                     \
+        NAME->data.TYPE[i][j] = VALUE;                                                                       \
+    }                                                                                                        \
+}
+
+
+static int testMaskBadPixels1(void);
+static int testMaskBadPixels2(void);
+static int testMaskBadPixels3(void);
+static int testMaskBadPixels4(void);
+static int testMaskBadPixels5(void);
+static int testMaskBadPixels6(void);
+static int testMaskBadPixels7(void);
+static int testMaskBadPixels8(void);
+static int testMaskBadPixels9(void);
+static int testMaskBadPixels10(void);
+static int testMaskBadPixels11(void);
+
+
+testDescription tests[] = {
+                              {testMaskBadPixels1, 885, "pmMaskBadPixels - Create mask based on maskVal argument", 0, false},
+                              {testMaskBadPixels2, 885, "pmMaskBadPixels - Create mask based on saturation argument", 0, false},
+                              {testMaskBadPixels3, 885, "pmMaskBadPixels - Create mask based on growVal and grow arguments", 0, false},
+                              {testMaskBadPixels4, 885, "pmMaskBadPixels - Auto create mask based on maskVal argument", 0, false},
+                              {testMaskBadPixels5, 885, "pmMaskBadPixels - Attempt to use null mask", 0, false},
+                              {testMaskBadPixels6, 885, "pmMaskBadPixels - Attempt tp use null input image", 0, false},
+                              {testMaskBadPixels7, 885, "pmMaskBadPixels - Attempt to use input image bigger than mask", 0, false},
+                              {testMaskBadPixels8, 885, "pmMaskBadPixels - Attempt to use input image mask bigger than mask", 0, false},
+                              {testMaskBadPixels9, 885, "pmMaskBadPixels - Attempt to use offset greater than input image", 0, false},
+                              {testMaskBadPixels10, 885, "pmMaskBadPixels - Attempt to use complex input image", 0, false},
+                              {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false},
+                              {NULL}
+                          };
+
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+
+int testMaskBadPixels1( void )
+{
+    // Test A - Create mask based on maskVal argument
+    CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50);
+    CREATE_AND_SET_IMAGE(mask1,U8,0,50,50)
+    //    pmReadout *inReadout = pmReadoutAlloc(0, 0, inImage1);
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+    inReadout->image = inImage1;
+    mask1->data.PS_TYPE_MASK_DATA[24][24]=1;
+    PRINT_MATRIX(mask1, U8, "Data mask:");
+    pmMaskBadPixels(inReadout, mask1, 1, 100.0, 0, 0);
+    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
+    psFree(mask1);
+    psFree(inReadout);
+
+    return 0;
+}
+
+int testMaskBadPixels2( void )
+{
+    // Test B - Create mask based on saturation argument
+    CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50);
+    CREATE_AND_SET_IMAGE(mask2,U8,0,50,50)
+    //    pmReadout *inReadout2 = pmReadoutAlloc(0, 0, inImage2);
+    pmReadout *inReadout2 = pmReadoutAlloc(NULL);
+    inReadout2->row0 = 0;
+    inReadout2->col0 = 0;
+    inReadout2->image = inImage2;
+    PRINT_MATRIX(mask2, U8, "Data mask:");
+    pmMaskBadPixels(inReadout2, mask2, 0, 100.0, 0, 0);
+    PRINT_MATRIX(inReadout2->mask, U8, "Resulting mask:");
+    psFree(mask2);
+    psFree(inReadout2);
+
+    return 0;
+}
+
+int testMaskBadPixels3( void )
+{
+    // Test C - Create mask based on growVal and grow arguments
+    CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50);
+    CREATE_AND_SET_IMAGE(mask3,U8,0,50,50)
+    //    pmReadout *inReadout3 = pmReadoutAlloc(0, 0, inImage3);
+    pmReadout *inReadout3 = pmReadoutAlloc(NULL);
+    inReadout3->row0 = 0;
+    inReadout3->col0 = 0;
+    inReadout3->image = inImage3;
+    mask3->data.PS_TYPE_MASK_DATA[24][24]=1;
+    mask3->data.PS_TYPE_MASK_DATA[4][3]=1;
+    mask3->data.PS_TYPE_MASK_DATA[4][46]=1;
+    PRINT_MATRIX(mask3, U8, "Data mask:");
+    pmMaskBadPixels(inReadout3, mask3, 0, 100.0, 1, 10);
+    PRINT_MATRIX(inReadout3->mask, U8, "Resulting mask:");
+    psFree(mask3);
+    psFree(inReadout3);
+
+    return 0;
+}
+
+int testMaskBadPixels4( void )
+{
+    // Test D - Auto Create mask based on maskVal argument
+    CREATE_AND_SET_IMAGE(inImage4,F64,50.0,50,50);
+    CREATE_AND_SET_IMAGE(mask4,U8,0,50,50)
+    CREATE_AND_SET_IMAGE(mask4i,U8,0,50,50)
+    //    pmReadout *inReadout4 = pmReadoutAlloc(0, 0, inImage4);
+    pmReadout *inReadout4 = pmReadoutAlloc(NULL);
+    inReadout4->row0 = 0;
+    inReadout4->col0 = 0;
+    inReadout4->image = inImage4;
+    inReadout4->mask = mask4i;
+    mask4->data.PS_TYPE_MASK_DATA[24][24]=1;
+    PRINT_MATRIX(mask4, U8, "Data mask:");
+    pmMaskBadPixels(inReadout4, mask4, 0, 100.0, 1, 10);
+    PRINT_MATRIX(inReadout4->mask, U8, "Resulting mask:");
+    psFree(mask4);
+    psFree(inReadout4);
+
+    return 0;
+}
+
+int testMaskBadPixels5( void )
+{
+    // Test E - Attempt to use null mask
+    CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50);
+    //    pmReadout *inReadout5 = pmReadoutAlloc(0, 0, inImage5);
+    pmReadout *inReadout5 = pmReadoutAlloc(NULL);
+    inReadout5->row0 = 0;
+    inReadout5->col0 = 0;
+    inReadout5->image = inImage5;
+    pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10);
+    psFree(inReadout5);
+
+    return 0;
+}
+
+int testMaskBadPixels6( void )
+{
+    // Test F - Attempt tp use null input image
+    CREATE_AND_SET_IMAGE(mask6,U8,0,50,50)
+    //    pmReadout *inReadout6 = pmReadoutAlloc(0, 0, NULL);
+    pmReadout *inReadout6 = pmReadoutAlloc(NULL);
+    inReadout6->row0 = 0;
+    inReadout6->col0 = 0;
+    inReadout6->mask = mask6;
+    pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10);
+    psFree(inReadout6);
+
+    return 0;
+}
+
+int testMaskBadPixels7( void )
+{
+    // Test G - Attempt to use input image bigger than mask
+    CREATE_AND_SET_IMAGE(inImage7,F64,0.0,60,60);
+    CREATE_AND_SET_IMAGE(mask7,U8,0,50,50)
+    CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50)
+    //    pmReadout *inReadout7 = pmReadoutAlloc(0, 0, inImage7);
+    pmReadout *inReadout7 = pmReadoutAlloc(NULL);
+    inReadout7->row0 = 0;
+    inReadout7->col0 = 0;
+    inReadout7->image = inImage7;
+    inReadout7->mask = mask7i;
+    pmMaskBadPixels(inReadout7, mask7, 0, 100.0, 1, 10);
+    psFree(mask7);
+    psFree(inReadout7);
+
+    return 0;
+}
+
+int testMaskBadPixels8( void )
+{
+    // Test H - Attempt to use input image mask bigger than mask
+    CREATE_AND_SET_IMAGE(inImage8,F64,0.0,50,50);
+    CREATE_AND_SET_IMAGE(mask8,U8,0,50,50)
+    CREATE_AND_SET_IMAGE(mask8i,U8,0,60,60)
+    //    pmReadout *inReadout8 = pmReadoutAlloc(0, 0, inImage8);
+    pmReadout *inReadout8 = pmReadoutAlloc(NULL);
+    inReadout8->row0 = 0;
+    inReadout8->col0 = 0;
+    inReadout8->image = inImage8;
+    inReadout8->mask = mask8i;
+    pmMaskBadPixels(inReadout8, mask8, 0, 100.0, 1, 10);
+    psFree(mask8);
+    psFree(inReadout8);
+
+    return 0;
+}
+
+int testMaskBadPixels9( void )
+{
+    // Test I - Attempt to use offset greater than input image
+    CREATE_AND_SET_IMAGE(inImage9,F64,0.0,50,50);
+    CREATE_AND_SET_IMAGE(mask9,U8,0,50,50)
+    CREATE_AND_SET_IMAGE(mask9i,U8,0,50,50)
+    //    pmReadout *inReadout9 = pmReadoutAlloc(0, 0, inImage9);
+    pmReadout *inReadout9 = pmReadoutAlloc(NULL);
+    inReadout9->image = inImage9;
+    inReadout9->mask = mask9i;
+    inReadout9->row0 = 0;
+    inReadout9->col0 = 0;
+    *(int*)&inReadout9->col0 = 150;
+    *(int*)&inReadout9->row0 = 150;
+    pmMaskBadPixels(inReadout9, mask9, 0, 100.0, 1, 10);
+    psFree(mask9);
+    psFree(inReadout9);
+
+    return 0;
+}
+
+int testMaskBadPixels10( void )
+{
+    // Test J - Attempt to use complex input image
+    CREATE_AND_SET_IMAGE(inImage10,C64,50.0,50,50);
+    CREATE_AND_SET_IMAGE(mask10,U8,0,50,50)
+    CREATE_AND_SET_IMAGE(mask10i,U8,0,50,50)
+    //    pmReadout *inReadout10 = pmReadoutAlloc(0, 0, inImage10);
+    pmReadout *inReadout10 = pmReadoutAlloc(NULL);
+    inReadout10->row0 = 0;
+    inReadout10->col0 = 0;
+    inReadout10->image = inImage10;
+    inReadout10->mask = mask10i;
+    pmMaskBadPixels(inReadout10, mask10, 0, 100.0, 1, 10);
+    psFree(mask10);
+    psFree(inReadout10);
+
+    return 0;
+}
+
+int testMaskBadPixels11( void )
+{
+    // Test K - Attempt to use non-mask type mask image
+    CREATE_AND_SET_IMAGE(inImage11,F64,50.0,50,50);
+    CREATE_AND_SET_IMAGE(mask11,F64,0,50,50)
+    CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50)
+    //    pmReadout *inReadout11 = pmReadoutAlloc(0, 0, inImage11);
+    pmReadout *inReadout11 = pmReadoutAlloc(NULL);
+    inReadout11->row0 = 0;
+    inReadout11->col0 = 0;
+    inReadout11->image = inImage11;
+    inReadout11->mask = mask11i;
+    pmMaskBadPixels(inReadout11, mask11, 0, 100.0, 1, 10);
+    psFree(mask11);
+    psFree(inReadout11);
+
+    return 0;
+}
+
Index: /trunk/psModules/test/detrend/tst_pmNonLinear.c
===================================================================
--- /trunk/psModules/test/detrend/tst_pmNonLinear.c	(revision 5169)
+++ /trunk/psModules/test/detrend/tst_pmNonLinear.c	(revision 5169)
@@ -0,0 +1,511 @@
+/** @file tst_pmNonLinear.c
+ *
+ *  @brief Contains the tests for pmNonLinear.c:
+ *
+ * test00: This code will create a simple polynomial, and call
+ * pmNonLinearityPolynomial() for a variety of image sizes [(1, 1), (1,
+ * N), (N, 1), (N, N)].  
+ *
+ * test01: This code will create simple table lookup vectors, and call
+ * pmNonLinearityPolynomial() for a variety of image sizes [(1, 1), (1,
+ * N), (N, 1), (N, N)].  
+ *
+ * test02, test03: This code tests the functions with various unallowable
+ * input parameters (NULLS) and incorrect vector sizes.
+ *
+ *  @author GLG, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmNonLinear.h"
+static int test00(void);
+static int test01(void);
+static int test02(void);
+static int test03(void);
+testDescription tests[] = {
+                              {test00, 000, "pmNonLinearityPolynomial", true, false},
+                              {test01, 000, "pmNonLinearityLookup", true, false},
+                              {test02, 000, "pmNonLinearityPolynomial(): error/warning conditions", true, false},
+                              {test03, 000, "pmNonLinearityLookup(): error/warning conditions", true, false},
+                              {NULL}
+                          };
+
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+#define NUM_ROWS 8
+#define NUM_COLS 8
+int doNonLinearityPolynomialTest(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = true;
+    psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = myImage;
+    psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD);
+    myPoly->coeff[1] = 1.0;
+
+    printPositiveTestHeader(stdout, "pmNonLinear", "doNonLinearityPolynomialTest");
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+    myReadout = pmNonLinearityPolynomial(myReadout, myPoly);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = psPolynomial1DEval(myPoly, (float) (i + j));
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(myPoly);
+    printFooter(stdout, "pmNonLinear", "doNonLinearityPolynomialTest", true);
+    return(testStatus);
+}
+
+int test00( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doNonLinearityPolynomialTest(1, 1);
+    testStatus |= doNonLinearityPolynomialTest(NUM_COLS, 1);
+    testStatus |= doNonLinearityPolynomialTest(1, NUM_ROWS);
+    testStatus |= doNonLinearityPolynomialTest(NUM_COLS, NUM_ROWS);
+
+    return(testStatus);
+}
+
+int doNonLinearityLookupTest(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = true;
+    int tableSize = PS_MAX(numCols, numRows)*2;
+    psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = myImage;
+    psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);
+    psVector *out = psVectorAlloc(tableSize, PS_TYPE_F32);
+
+    printPositiveTestHeader(stdout, "pmNonLinear", "doNonLinearityLookupTest");
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+    for (i=0;i<tableSize;i++) {
+        in->data.F32[i] = (float) i;
+        out->data.F32[i] = (float) (2 * i);
+    }
+
+    myReadout = pmNonLinearityLookup(myReadout, in, out);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = (float) (2 * (i + j));
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(in);
+    psFree(out);
+    printFooter(stdout, "pmNonLinear", "doNonLinearityLookupTest", true);
+    return(testStatus);
+}
+
+int test01( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doNonLinearityLookupTest(1, 1);
+    testStatus |= doNonLinearityLookupTest(NUM_COLS, 1);
+    testStatus |= doNonLinearityLookupTest(1, NUM_ROWS);
+    testStatus |= doNonLinearityLookupTest (NUM_COLS, NUM_ROWS);
+
+    return(testStatus);
+}
+
+int test02( void )
+{
+    int i;
+    int j;
+    int testStatus = true;
+    psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *rc = NULL;
+    myReadout->image = myImage;
+    psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD);
+    myPoly->coeff[1] = 1.0;
+
+    printPositiveTestHeader(stdout, "pmNonLinear", "Testing bad input parameter conditions.");
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityPolynomial() with NULL input readout.  Should generate error, return NULL.\n");
+    rc = pmNonLinearityPolynomial(NULL, myPoly);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityPolynomial() with NULL input readout->image.  Should generate error, return NULL.\n");
+    psImage *tmpImage = myReadout->image;
+    myReadout->image = NULL;
+    rc = pmNonLinearityPolynomial(myReadout, myPoly);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+    myReadout->image = tmpImage;
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityPolynomial() with NULL polynomial.  Should generate error, return NULL.\n");
+    rc = pmNonLinearityPolynomial(myReadout, NULL);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    psFree(myReadout);
+    psFree(myPoly);
+    return(testStatus);
+}
+
+
+int test03Init(pmReadout *myReadout)
+{
+    for (psS32 i=0;i<NUM_ROWS;i++) {
+        for (psS32 j=0;j<NUM_COLS;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+    return(0);
+}
+
+int test03()
+{
+    int i;
+    int j;
+    int testStatus = true;
+    int tableSize = PS_MAX(NUM_COLS, NUM_ROWS)*3;
+    psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *rc = NULL;
+    myReadout->image = myImage;
+    psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);
+    psVector *inOne = psVectorAlloc(1, PS_TYPE_F32);
+    psVector *inSmall = psVectorAlloc(tableSize-1, PS_TYPE_F32);
+    psVector *inBig = psVectorAlloc(tableSize+1, PS_TYPE_F32);
+    psVector *out = psVectorAlloc(tableSize, PS_TYPE_F32);
+    psVector *outOne = psVectorAlloc(1, PS_TYPE_F32);
+    psVector *outSmall = psVectorAlloc(tableSize-1, PS_TYPE_F32);
+    psVector *outBig = psVectorAlloc(tableSize+1, PS_TYPE_F32);
+
+    test03Init(myReadout);
+    for (i=0;i<tableSize;i++) {
+        in->data.F32[i] = (float) i;
+        out->data.F32[i] = (float) (2 * i);
+        inBig->data.F32[i] = (float) i;
+        outBig->data.F32[i] = (float) (2 * i);
+        if (i < tableSize-1) {
+            inSmall->data.F32[i] = (float) i;
+            outSmall->data.F32[i] = (float) (2 * i);
+        }
+    }
+    inBig->data.F32[tableSize] = (float) tableSize;
+    outBig->data.F32[tableSize] = (float) (2 * tableSize);
+    inOne->data.F32[0] = 0.0;
+    outOne->data.F32[0] = 0.0;
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with NULL input pmReadout.  Should generate error, return NULL.\n");
+    rc = pmNonLinearityLookup(NULL, in, out);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with NULL input pmReadout->image.  Should generate error, return NULL.\n");
+    psImage *tmpImage = myReadout->image;
+    myReadout->image = NULL;
+    rc = pmNonLinearityLookup(myReadout, in, out);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+    myReadout->image = tmpImage;
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with NULL inFlux psVector.  Should generate error, return NULL.\n");
+    rc = pmNonLinearityLookup(myReadout, NULL, out);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with NULL outFlux psVector.  Should generate error, return NULL.\n");
+    rc = pmNonLinearityLookup(myReadout, in, NULL);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, in, outBig);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, in, outSmall);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, inSmall, out);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, inBig, out);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, inSmall, outBig);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.\n");
+    rc = pmNonLinearityLookup(myReadout, inBig, outSmall);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original pmReadout.\n");
+    rc = pmNonLinearityLookup(myReadout, inOne, out);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) ((i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.\n");
+    test03Init(myReadout);
+    myReadout->image->data.F32[0][0] = -1;
+    rc = pmNonLinearityLookup(myReadout, in, out);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if(i==0 && j==0) {
+                if(actual != 0.0) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,0.0);
+                }
+            } else {
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = false;
+                }
+            }
+        }
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.\n");
+    test03Init(myReadout);
+    myReadout->image->data.F32[NUM_ROWS-1][NUM_COLS-1] = 100;
+    rc = pmNonLinearityLookup(myReadout, in, out);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if(i==(NUM_ROWS-1) && j==(NUM_COLS-1)) {
+                if(actual != (tableSize-1)*2) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,(tableSize-1)*2.0);
+                }
+            } else {
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = false;
+                }
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with image values not in vector.\n");
+    myReadout->image->data.F32[0][0] = 0.5;
+    rc = pmNonLinearityLookup(myReadout, in, out);
+    if (rc == NULL) {
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            if(i==0 && j==0) {
+                expect = 1.0;
+            }
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    psFree(myReadout);
+    psFree(in);
+    psFree(inOne);
+    psFree(inSmall);
+    psFree(inBig);
+    psFree(out);
+    psFree(outOne);
+    psFree(outSmall);
+    psFree(outBig);
+
+    printFooter(stdout, "pmNonLinear", "Testing bad input parameter conditions.", true);
+    return(testStatus);
+}
Index: /trunk/psModules/test/detrend/verified/tst_pmFlatField.stderr
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmFlatField.stderr	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmFlatField.stderr	(revision 5169)
@@ -0,0 +1,29 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: Test Point Driver{pmFlatField}                             *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Null not allowed for flat readout.
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Null not allowed for input image.
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Null not allowed for flat image.
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image size exceeds that of flat image: (3, 3) vs (2, 2)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+<HOST>|E|pmFlatField (FILE:LINENO)
+    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
+
+---> TESTPOINT PASSED (Test Point Driver{pmFlatField} | tst_pmFlatField.c)
+
Index: /trunk/psModules/test/detrend/verified/tst_pmFlatField.stdout
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmFlatField.stdout	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmFlatField.stdout	(revision 5169)
@@ -0,0 +1,241 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test A - Divide input image by flat image}     *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+Input image:
+6.000000 6.000000 6.000000 
+6.000000 6.000000 6.000000 
+6.000000 6.000000 6.000000 
+
+Input mask:
+0 0 0 
+0 0 0 
+0 0 0 
+
+Flat image:
+2.000000 2.000000 2.000000 
+2.000000 2.000000 2.000000 
+2.000000 2.000000 2.000000 
+
+Resulting image:
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+
+
+---> TESTPOINT PASSED (pmFlatField{Test A - Divide input image by flat image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test B - Mask flat image data}                 *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+Input image:
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+
+Flat image:
+0.000000 0.000000 0.000000 
+0.000000 0.000000 0.000000 
+0.000000 0.000000 0.000000 
+
+Resulting mask:
+8 8 8 
+8 8 8 
+8 8 8 
+
+Resulting image:
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+
+
+---> TESTPOINT PASSED (pmFlatField{Test B - Mask flat image data} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test C - Mask flat image data starting with non-null mask} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+Input image:
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+
+Flat image:
+0.000000 0.000000 0.000000 
+0.000000 0.000000 0.000000 
+3.000000 -3.000000 0.000000 
+
+Flat image out:
+0.000000 0.000000 0.000000 
+0.000000 0.000000 0.000000 
+3.000000 0.000000 0.000000 
+
+Resulting mask:
+0 0 0 
+0 0 0 
+0 0 0 
+
+Resulting image:
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+3.000000 3.000000 3.000000 
+
+
+---> TESTPOINT PASSED (pmFlatField{Test C - Mask flat image data starting with non-null mask} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test D - Attempt to use null flat readout}     *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Null not allowed for flat readout                          *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test D - Attempt to use null flat readout} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test E - Attempt to use null input image}      *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Null not allowed for input image                           *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test E - Attempt to use null input image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test F - Attempt tp use null flat image}       *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Null not allowed for flat image                            *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test F - Attempt tp use null flat image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test G - Attempt to use input image bigger than flat image} *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Input image size exceeds that of flat image                *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test G - Attempt to use input image bigger than flat image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test H - Attempt to use input image mask bigger than flat image} *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Input image mask size exceeds that of flat image           *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test H - Attempt to use input image mask bigger than flat image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test I - Attempt to use offset greater than input image} *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Total offset >= input image size                           *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test I - Attempt to use offset greater than input image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test J - Attempt to use complex input image}   *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Complex types not allowed for input image                  *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test J - Attempt to use complex input image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test K - Attempt to use complex flat image}    *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Complex types not allowed for flat image                   *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test K - Attempt to use complex flat image} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test L - Attempt to use non-equal input and flat image types} *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Input and flat image types differ                          *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test L - Attempt to use non-equal input and flat image types} | tst_pmFlatField.c)
+
+
+
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmFlatField.c                                          *
+*            TestPoint: pmFlatField{Test M - Attempt to use non-mask type mask image} *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Mask must be PS_TYPE_MASK type                             *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmFlatField{Test M - Attempt to use non-mask type mask image} | tst_pmFlatField.c)
+
+
+
+
Index: /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stderr
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stderr	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stderr	(revision 5169)
@@ -0,0 +1,113 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on maskVal argument} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on maskVal argument} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on saturation argument} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on saturation argument} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on growVal and grow argum *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on growVal and grow arguments} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Auto create mask based on maskVal argument} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Auto create mask based on maskVal argument} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use null mask} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Null not allowed for mask image.
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use null mask} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt tp use null input image} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Null not allowed for input image.
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt tp use null input image} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use input image bigger than mask *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Input image size exceeds that of mask image: (60, 60) vs (50, 50)
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use input image bigger than mask} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use input image mask bigger than *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Input image mask size exceeds that of mask image: (60, 60) vs (50, 50)
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use input image mask bigger than mask} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use offset greater than input im *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Total offset >= mask image: (150, 150) vs (50, 50)
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use offset greater than input image} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use complex input image} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Complex types not allowed for input image. Type: 2064
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use complex input image} | tst_pmMaskBadPixels.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmMaskBadPixels.c                                      *
+*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use non-mask type mask image} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMaskBadPixels (FILE:LINENO)
+    Mask must be PS_TYPE_MASK type. Type: 1032
+
+---> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use non-mask type mask image} | tst_pmMaskBadPixels.c)
+
Index: /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stdout
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stdout	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmMaskBadPixels.stdout	(revision 5169)
@@ -0,0 +1,416 @@
+Data mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000010000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
+Resulting mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000010000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
+Data mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
+Resulting mask:
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+44444444444444444444444444444444444444444444444444
+
+Data mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000010000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00010000000000000000000000000000000000000000001000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
+Resulting mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000011111110000000000000000000000
+00000000000000000001111111111100000000000000000000
+00000000000000000011111111111110000000000000000000
+00000000000000000111111111111111000000000000000000
+00000000000000001111111111111111100000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000001111111111111111100000000000000000
+00000000000000000111111111111111000000000000000000
+00000000000000000011111111111110000000000000000000
+00000000000000000001111111111100000000000000000000
+11111110000000000000011111110000000000000001111111
+11111111100000000000000000000000000000000111111111
+11111111110000000000000000000000000000001111111111
+11111111111000000000000000000000000000011111111111
+11111111111100000000000000000000000000111111111111
+11111111111110000000000000000000000001111111111111
+11111111111110000000000000000000000001111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111111000000000000000000000011111111111111
+11111111111110000000000000000000000001111111111111
+
+Data mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000010000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
+Resulting mask:
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000011111110000000000000000000000
+00000000000000000001111111111100000000000000000000
+00000000000000000011111111111110000000000000000000
+00000000000000000111111111111111000000000000000000
+00000000000000001111111111111111100000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000111111111111111111111000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000011111111111111111110000000000000000
+00000000000000001111111111111111100000000000000000
+00000000000000000111111111111111000000000000000000
+00000000000000000011111111111110000000000000000000
+00000000000000000001111111111100000000000000000000
+00000000000000000000011111110000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000
+
Index: /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stderr
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stderr	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stderr	(revision 5169)
@@ -0,0 +1,72 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: Test Point Driver{pmNonLinearityPolynomial}                *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityPolynomial} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: Test Point Driver{pmNonLinearityLookup}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: Test Point Driver{pmNonLinearityPolynomial(): error/warning conditions} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+    Unallowable operation: inputReadout is NULL.
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+    Unallowable operation: inputReadout->image is NULL.
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+    Unallowable operation: input1DPoly is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityPolynomial(): error/warning conditions} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: Test Point Driver{pmNonLinearityLookup(): error/warning conditions} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+    Unallowable operation: inputReadout is NULL.
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+    Unallowable operation: inputReadout->image is NULL.
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+    Unallowable operation: inFlux is NULL.
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+    Unallowable operation: outFlux is NULL.
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 25)
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 23)
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 24)
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 24)
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 25)
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 23)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+    pmNonLinearityLookup(): input vector less than 2 elements.  Returning inputReadout image.
+<HOST>|W|vectorBinDisectF32
+    vectorBinDisectF32(): ordinate -1.000000 is outside vector range (0.000000 - 23.000000).
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
+<HOST>|W|vectorBinDisectF32
+    vectorBinDisectF32(): ordinate 100.000000 is outside vector range (0.000000 - 23.000000).
+<HOST>|W|pmNonLinearityLookup
+    WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
+
+---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup(): error/warning conditions} | tst_pmNonLinear.c)
+
Index: /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stdout
===================================================================
--- /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stdout	(revision 5169)
+++ /trunk/psModules/test/detrend/verified/tst_pmNonLinear.stdout	(revision 5169)
@@ -0,0 +1,115 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmNonLinear.c                                          *
+*            TestPoint: pmNonLinear{Testing bad input parameter conditions.}       *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+------------------------------------------------------------
+Calling pmNonLinearityPolynomial() with NULL input readout.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityPolynomial() with NULL input readout->image.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityPolynomial() with NULL polynomial.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with NULL input pmReadout.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with NULL input pmReadout->image.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with NULL inFlux psVector.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with NULL outFlux psVector.  Should generate error, return NULL.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original pmReadout.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
+------------------------------------------------------------
+Calling pmNonLinearityLookup() with image values not in vector.
+
+---> TESTPOINT PASSED (pmNonLinear{Testing bad input parameter conditions.} | tst_pmNonLinear.c)
+
Index: /trunk/psModules/test/imcombine/Makefile.am
===================================================================
--- /trunk/psModules/test/imcombine/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/imcombine/Makefile.am	(revision 5169)
@@ -0,0 +1,23 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+
+TESTS = \
+    tst_pmImageCombine \
+    tst_pmReadoutCombine
+
+tst_pmImageCombine_SOURCES = tst_pmImageCombine.c
+tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/imcombine/tst_pmImageCombine.c
===================================================================
--- /trunk/psModules/test/imcombine/tst_pmImageCombine.c	(revision 5169)
+++ /trunk/psModules/test/imcombine/tst_pmImageCombine.c	(revision 5169)
@@ -0,0 +1,352 @@
+/** @file tst_pmImageCombine.c
+ *
+ *  @brief Contains the tests for pmImageCombine.c:
+ *
+ *  test00: This code will test the various functions in the pmImageCombine.c file.
+ *
+ *  @author GLG, MHPCC
+ *
+ *  XXX: Must verify the results internally.  Don't use stdout file.
+ *  XXX: Must test masks with pmRejectPixels()
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+#include "psTest.h"
+#include "pslib.h"
+#include "pmImageCombine.h"
+static int test00(void);
+testDescription tests[] = {
+                              {test00, 000, "pmCombineImages()", true, false},
+                              {NULL}
+                          };
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+psF32 genRanFloat(psF32 low,
+                  psF32 high)
+{
+    psF32 ran1 = (((psF32) (random() % 10000)) / 10000.0);
+    return(low + (ran1 * (high - low)));
+}
+
+psF32 genRanInt(psS32 low,
+                psS32 high)
+{
+    psF32 ran1 = (((psF32) (random() % 10000)) / 10000.0);
+    return((psS32) (low + (ran1 * (high - low))));
+}
+
+#define TST00_EXPANSION_FACTOR_X 1.0
+#define TST00_EXPANSION_FACTOR_Y 1.0
+#define TST00_OFFSET_X 0.0
+#define TST00_OFFSET_Y 0.0
+#define TST00_NUM_PIXELS 10
+#define TST00_MASK_VALUE 1
+#define TST00_NUM_ITERATIONS 4
+#define TST00_SIGMA_CLIP 1.0
+#define TST00_REJECTION_THRESHOLD 0.01
+#define TST00_GRADIENT_LIMIT 10.0
+/*******************************************************************************
+NOTE: This function returns FALSE if there were no errors.
+ ******************************************************************************/
+psBool testCombineImages(psS32 numRows,
+                         psS32 numCols,
+                         psS32 numImages)
+{
+    printf("Testing pmCombineImages(%d, %d, %d)\n", numRows, numCols, numImages);
+    bool testStatus = false;
+
+    psArray *images = psArrayAlloc(numImages);
+    psArray *errors = psArrayAlloc(numImages);
+    psArray *masks = psArrayAlloc(numImages);
+    for (psS32 i = 0 ; i < numImages ; i++) {
+        images->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32);
+        errors->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32);
+        masks->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_U8);
+        psImage *image = (psImage *) images->data[i];
+        psImage *error = (psImage *) errors->data[i];
+        psImage *mask = (psImage *) masks->data[i];
+        PS_IMAGE_SET_F32(image, 0.0);
+        PS_IMAGE_SET_F32(error, 1.0);
+        PS_IMAGE_SET_U8(mask, 0);
+
+        for (psS32 row = 0 ; row < numRows ; row++) {
+            for (psS32 col = 0 ; col < numCols ; col++) {
+                // Scale row/col to [-1.0:1.0]
+                psF32 rowScaled = ((psF32) (row - (numRows/2))) / ((psF32) (numRows/2));
+                psF32 colScaled = ((psF32) (col - (numCols/2))) / ((psF32) (numCols/2));
+                image->data.F32[row][col] = PS_SQR((2.0 - rowScaled) + (2.0 - colScaled)) + genRanFloat(0.0, 0.5);
+            }
+        }
+    }
+
+    //
+    // Same as above except the numImages is wrong
+    //
+    psArray *imagesLong = psArrayAlloc(numImages+1);
+    psArray *errorsLong = psArrayAlloc(numImages+1);
+    psArray *masksLong = psArrayAlloc(numImages+1);
+    for (psS32 i = 0 ; i < numImages+1 ; i++) {
+        imagesLong->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32);
+        errorsLong->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32);
+        masksLong->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_U8);
+        psImage *image = (psImage *) imagesLong->data[i];
+        psImage *error = (psImage *) errorsLong->data[i];
+        psImage *mask = (psImage *) masksLong->data[i];
+        PS_IMAGE_SET_F32(image, 0.0);
+        PS_IMAGE_SET_F32(error, 1.0);
+        PS_IMAGE_SET_U8(mask, 0);
+
+        for (psS32 row = 0 ; row < numRows ; row++) {
+            for (psS32 col = 0 ; col < numCols ; col++) {
+                // Scale row/col to [-1.0:1.0]
+                psF32 rowScaled = ((psF32) (row - (numRows/2))) / ((psF32) (numRows/2));
+                psF32 colScaled = ((psF32) (col - (numCols/2))) / ((psF32) (numCols/2));
+                image->data.F32[row][col] = PS_SQR((2.0 - rowScaled) + (2.0 - colScaled)) + genRanFloat(0.0, 0.5);
+            }
+        }
+    }
+
+    //
+    // Same as above except the type is wrong
+    //
+    psArray *imagesBadType = psArrayAlloc(numImages);
+    psArray *errorsBadType = psArrayAlloc(numImages);
+    psArray *masksBadType = psArrayAlloc(numImages);
+    for (psS32 i = 0 ; i < numImages ; i++) {
+        imagesBadType->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F64);
+        errorsBadType->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F64);
+        masksBadType->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_S8);
+        psImage *image = (psImage *) imagesBadType->data[i];
+        psImage *error = (psImage *) errorsBadType->data[i];
+        psImage *mask = (psImage *) masksBadType    ->data[i];
+        PS_IMAGE_SET_F32(image, 0.0);
+        PS_IMAGE_SET_F32(error, 1.0);
+        PS_IMAGE_SET_U8(mask, 0);
+
+        for (psS32 row = 0 ; row < numRows ; row++) {
+            for (psS32 col = 0 ; col < numCols ; col++) {
+                // Scale row/col to [-1.0:1.0]
+                psF32 rowScaled = ((psF32) (row - (numRows/2))) / ((psF32) (numRows/2));
+                psF32 colScaled = ((psF32) (col - (numCols/2))) / ((psF32) (numCols/2));
+                image->data.F32[row][col] = PS_SQR((2.0 - rowScaled) + (2.0 - colScaled)) + genRanFloat(0.0, 0.5);
+            }
+        }
+    }
+
+    psPixels *pixels = psPixelsAlloc(TST00_NUM_PIXELS);
+    for (psS32 p = 0 ; p < TST00_NUM_PIXELS ; p++) {
+        psS32 col =  genRanInt(0, numCols);
+        psS32 row =  genRanInt(0, numRows);
+        pixels->data[p].x = (psF32) col;
+        pixels->data[p].y = (psF32) row;
+        psS32 im = genRanInt(0, numImages-1);
+        psImage *image = (psImage *) images->data[im];
+        image->data.F32[row][col] += 100.0;
+        printf("Generating a bad pixel in image (%d) at (%d, %d)\n", im, row, col);
+    }
+
+    psArray *questionablePixels = NULL;
+    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a NULL images.  Should generate error, return NULL.\n");
+    psImage *outImg = pmCombineImages(NULL, &questionablePixels, NULL, errors,
+                                      masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                                      TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a long images.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, imagesLong, errors,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a bad type images.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, imagesBadType, errors,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a long errors.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errorsLong,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a bad type errors.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errorsBadType,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a long masks.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errors,
+                             masksLong, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a bad type masks.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errors,
+                             masksBadType, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a NULL stats.  Should generate error, return NULL.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errors,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, NULL);
+    if (outImg != NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a non-NULL psImage.\n");
+        psFree(outImg);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with acceptable data.  Should generate a psImage.\n");
+    outImg = pmCombineImages(NULL, &questionablePixels, images, errors,
+                             masks, TST00_MASK_VALUE, pixels, TST00_NUM_ITERATIONS,
+                             TST00_SIGMA_CLIP, stats);
+    if (outImg == NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a NULL psImage.\n");
+        testStatus = true;
+    }
+    if (0) {
+        for (psS32 p = 0 ; p < TST00_NUM_PIXELS ; p++) {
+            psS32 col = (psS32) (pixels->data[p]).x;
+            psS32 row = (psS32) (pixels->data[p]).y;
+            printf("------------------------------------------\n");
+            printf("Pixel (%d, %d) in combined image is %f\n", row, col, outImg->data.F32[row][col]);
+            for (psS32 i = 0 ; i < numImages ; i++) {
+                psImage *image = (psImage *) images->data[i];
+                printf("Pixel (after combine) (%d, %d) in image (%d) is %f\n", row, col, i, image->data.F32[row][col]);
+            }
+        }
+    }
+
+    if (questionablePixels->n != numImages) {
+        printf("TEST ERROR: pmCombineImages(): questionablePixels->n was %ld, should have been %d\n",
+               questionablePixels->n, numImages);
+        testStatus = true;
+    } else {
+        // XXX: We should internally verify this with the pixels list, not merely use the stdout.
+        for (psS32 i = 0 ; i < questionablePixels->n ; i++) {
+            psPixels *myPixels = (psPixels *) questionablePixels->data[i];
+            for (psS32 p = 0 ; p < myPixels->n ; p++) {
+                printf("Image %d, questionable pixel %d is (%d %d)\n", i, p, myPixels->data[p].y, myPixels->data[p].x);
+            }
+        }
+    }
+
+    psArray *expandTransforms = psArrayAlloc(numImages);
+    psArray *contractTransforms = psArrayAlloc(numImages);
+    for (psS32 im = 0 ; im < numImages ; im++) {
+        psPlaneTransform *ptExpand = psPlaneTransformAlloc(2, 2);
+        ptExpand->x->coeff[0][0] = TST00_OFFSET_X;
+        ptExpand->x->coeff[1][0] = TST00_EXPANSION_FACTOR_X;
+        ptExpand->y->coeff[0][0] = TST00_OFFSET_Y;
+        ptExpand->y->coeff[0][1] = TST00_EXPANSION_FACTOR_Y;
+        expandTransforms->data[im] = (psPtr *) ptExpand;
+
+        psPlaneTransform *ptContract = psPlaneTransformAlloc(2, 2);
+        ptContract->x->coeff[0][0] = -TST00_OFFSET_X;
+        ptContract->x->coeff[1][0] = 1.0 / TST00_EXPANSION_FACTOR_X;
+        ptContract->y->coeff[0][0] = -TST00_OFFSET_Y;
+        ptContract->y->coeff[0][1] = 1.0 / TST00_EXPANSION_FACTOR_Y;
+        contractTransforms->data[im] = (psPtr *) ptContract;
+    }
+
+    //-------------------------------------------------------------------------
+    //
+    // XXX: psRejectPixels() has known bugs.  Specifically, in the psImageTransform() call.
+    // We exclude this from our tests.
+    //
+    printf("\n\n\nCalling pmRejectPixels() with acceptable data.  Should generate a psArray.\n");
+    psArray *pixelRejects = pmRejectPixels(images, NULL, questionablePixels, expandTransforms,
+                                           contractTransforms, TST00_REJECTION_THRESHOLD,
+                                           TST00_GRADIENT_LIMIT);
+    if (pixelRejects == NULL) {
+        printf("TEST ERROR: pmRejectPixels() returned a NULL psArray.\n");
+        testStatus = true;
+    } else {
+        // XXX: We should internally verify this with the pixels list, not merely use the stdout.
+        for (psS32 i = 0 ; i < pixelRejects->n ; i++) {
+            psPixels *myPixels = (psPixels *) pixelRejects->data[i];
+            printf("tst_pmImageCombine.c: Image %d had %ld rejects.\n", i, myPixels->n);
+
+            for (psS32 p = 0 ; p < myPixels->n ; p++) {
+                printf("Image %d, rejected pixel %d is (%d %d)\n", i, p,
+                       myPixels->data[p].y, myPixels->data[p].x);
+            }
+        }
+        psFree(pixelRejects);
+    }
+
+    psFree(images);
+    psFree(errors);
+    psFree(masks);
+    psFree(imagesLong);
+    psFree(errorsLong);
+    psFree(masksLong);
+    psFree(imagesBadType);
+    psFree(errorsBadType);
+    psFree(masksBadType);
+    psFree(pixels);
+    psFree(stats);
+
+    return(testStatus);
+}
+
+/*******************************************************************************
+NOTE: This function returns TRUE if there were no errors.
+ ******************************************************************************/
+int test00( void )
+{
+    bool testStatus = false;
+
+    testStatus|= testCombineImages(10, 10, 5);
+
+    return(!testStatus);
+}
Index: /trunk/psModules/test/imcombine/tst_pmReadoutCombine.c
===================================================================
--- /trunk/psModules/test/imcombine/tst_pmReadoutCombine.c	(revision 5169)
+++ /trunk/psModules/test/imcombine/tst_pmReadoutCombine.c	(revision 5169)
@@ -0,0 +1,452 @@
+/** @file tst_pmReadoutCombine.c
+ *
+ *  test00() This routine will test the basic functionality.
+ *
+ *  @author GLG, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ *  XXX: Untested:
+ * S16, S32 types
+ * Multiple input readouts with varying sizes and offsets.
+ * params->fracLow and params->fracHigh
+ * params->nKeep
+ * (gain > 0.0) && (readnoise >= 0.0) (applyZeroScale == true)
+ * (gain > 0.0) && (readnoise >= 0.0) (applyZeroScale == false)
+ *
+ */
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmReadoutCombine.h"
+static int test00(void);
+static int test01(void);
+testDescription tests[] = {
+                              {test00, 000, "pmSubtractBias(): Basic readout combines with no image overlap", true, false},
+                              {test01, 000, "pmSubtractBias(): input parameter error conditions", true, false},
+                              {NULL}
+                          };
+
+#define NUM_READOUTS  10
+#define INPUT_NUM_ROWS 20
+#define INPUT_NUM_COLS 20
+#define VEC_ZERO 1.0
+#define VEC_SCALE 2.0
+
+psS32 VerifyTheOutput(psImage *output, psF32 expect)
+{
+    bool testStatus = true;
+
+    for (psS32 i = 0 ; i < output->numRows ; i++) {
+        for (psS32 j = 0 ; j < output->numCols ; j++) {
+            if (output->data.F32[i][j] != expect) {
+                printf("TEST ERROR: output[%d][%d] is %.2f, should be %f\n", i, j, output->data.F32[i][j], expect);
+                testStatus = false;
+            }
+        }
+    }
+    return(testStatus);
+}
+
+
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+/******************************************************************************
+simpleCombineNoOverlap(): this routine creates a list of NUM_READOUTS input
+readouts and calls pmReadoutCombine().
+ *****************************************************************************/
+int simpleCombineNoOverlap(psS32 numInputCols, psS32 numInputRows)
+{
+    int i;
+    int r;
+    psList *list = NULL;
+    int baseRowsReadout[NUM_READOUTS];
+    int baseColsReadout[NUM_READOUTS];
+    int baseRows[NUM_READOUTS];
+    int baseCols[NUM_READOUTS];
+    int numRows[NUM_READOUTS];
+    int numCols[NUM_READOUTS];
+    int minOutRow = 10000;
+    int minOutCol = 10000;
+    int maxOutRow = -1;
+    int maxOutCol = -1;
+    psImage *output = NULL;
+    psCombineParams *params = (psCombineParams *) psAlloc(sizeof(psCombineParams));
+    psVector *zero = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32);
+    psVector *scale = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32);
+    printPositiveTestHeader(stdout, "pmReadoutCombine", "simpleCombineNoOverlap");
+
+    for (i=0;i<NUM_READOUTS;i++) {
+        zero->data.F32[i] = VEC_ZERO;
+    }
+    for (i=0;i<NUM_READOUTS;i++) {
+        scale->data.F32[i] = VEC_SCALE;
+    }
+
+    params->stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    params->maskVal = 1;
+    params->fracLow = 0.0;
+    params->fracHigh = 10000.0;
+    params->nKeep = 0;
+
+    //
+    // Create a psList of psReadouts.  The pixels in readout r will all have the
+    // value r.
+    //
+    for (r=0;r<NUM_READOUTS;r++) {
+        baseRowsReadout[r] = r + 40;
+        baseColsReadout[r] = r + 42;
+        baseRows[r] = r;
+        baseCols[r] = r+2;
+        numRows[r] = 4 + (2 * r);
+        numCols[r] = 8 + (2 * r);
+
+        baseRowsReadout[r] = 0;
+        baseColsReadout[r] = 0;
+        baseRows[r] = 0;
+        baseCols[r] = 0;
+        numRows[r] = numInputRows;
+        numCols[r] = numInputCols;
+
+        psImage *tmpImage = psImageAlloc(numCols[r], numRows[r], PS_TYPE_F32);
+        PS_IMAGE_SET_F32(tmpImage, ((float) r));
+        *(int *) (& (tmpImage->row0)) = baseRows[r];
+        *(int *) (& (tmpImage->col0)) = baseCols[r];
+        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
+        tmpReadout->row0 = 0;
+        tmpReadout->col0 = 0;
+        tmpReadout->image = tmpImage;
+
+        minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r]));
+        minOutCol = PS_MIN(minOutCol, (baseColsReadout[r] + baseCols[r]));
+        maxOutRow = PS_MAX(maxOutRow, (baseRowsReadout[r] + baseRows[r] + numRows[r]));
+        maxOutCol = PS_MAX(maxOutCol, (baseColsReadout[r] + baseCols[r] + numCols[r]));
+
+        if (r == 0) {
+            list = psListAlloc(tmpReadout);
+        } else {
+            psListAdd(list, PS_LIST_HEAD, tmpReadout);
+        }
+    }
+    printf("tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (%d, %d) (%d, %d)\n",
+           minOutRow, minOutCol, maxOutRow, maxOutCol);
+
+    output = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
+    psF32 NR = (psF32) NUM_READOUTS;
+    psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR;
+
+    int testStatus = VerifyTheOutput(output, expectedPixel);
+
+    psFree(params->stats);
+    psFree(params);
+    psFree(output);
+    psFree(zero);
+    psFree(scale);
+
+    psListElem *tmpInput = (psListElem *) list->head;
+    while (NULL != tmpInput) {
+        pmReadout *tmpReadout = (pmReadout *) tmpInput->data;
+        psFree(tmpReadout);
+        tmpInput = tmpInput->next;
+    }
+    psFree(list);
+
+    printFooter(stdout, "pmReadoutCombine", "simpleCombineNoOverlap", true);
+    return(testStatus);
+}
+
+int test00( void )
+{
+    int testStatus = 0;
+
+    testStatus |= simpleCombineNoOverlap(1, 1);
+    testStatus |= simpleCombineNoOverlap(INPUT_NUM_COLS, 1);
+    testStatus |= simpleCombineNoOverlap(1, INPUT_NUM_ROWS);
+    testStatus |= simpleCombineNoOverlap(INPUT_NUM_COLS, INPUT_NUM_ROWS);
+
+    return(testStatus);
+}
+
+/******************************************************************************
+test01(): we simply call pmReadoutCombine() with a variety of erroneous input
+parameter combinations and verify that it behaves properly.
+ *****************************************************************************/
+int test01()
+{
+    int testStatus = true;
+    int i;
+    int r;
+    psList *list = NULL;
+    int baseRowsReadout[NUM_READOUTS];
+    int baseColsReadout[NUM_READOUTS];
+    int baseRows[NUM_READOUTS];
+    int baseCols[NUM_READOUTS];
+    int numRows[NUM_READOUTS];
+    int numCols[NUM_READOUTS];
+    int minOutRow = 10000;
+    int minOutCol = 10000;
+    int maxOutRow = -1;
+    int maxOutCol = -1;
+    psImage *output = NULL;
+    psImage *rc = NULL;
+    psCombineParams *params = (psCombineParams *) psAlloc(sizeof(psCombineParams));
+    psVector *zero = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32);
+    psVector *zeroHalf = psVectorAlloc(NUM_READOUTS/2, PS_TYPE_F32);
+    psVector *zeroBig = psVectorAlloc(NUM_READOUTS+1, PS_TYPE_F32);
+    psVector *zeroF64 = psVectorAlloc(NUM_READOUTS, PS_TYPE_F64);
+    psVector *scale = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32);
+    psVector *scaleHalf = psVectorAlloc(NUM_READOUTS/2, PS_TYPE_F32);
+    psVector *scaleBig = psVectorAlloc(NUM_READOUTS*2, PS_TYPE_F32);
+    psVector *scaleF64 = psVectorAlloc(NUM_READOUTS, PS_TYPE_F64);
+    for (i=0;i<NUM_READOUTS;i++) {
+        zero->data.F32[i] = 3.0;
+        zeroBig->data.F32[i] = 3.0;
+        zero->data.F32[i] = VEC_ZERO;
+        zeroBig->data.F32[i] = VEC_ZERO;
+    }
+    for (i=0;i<NUM_READOUTS;i++) {
+        scale->data.F32[i] = 6.0;
+        scaleBig->data.F32[i] = 6.0;
+        scale->data.F32[i] = VEC_SCALE;
+        scaleBig->data.F32[i] = VEC_SCALE;
+    }
+    printPositiveTestHeader(stdout, "pmReadoutCombine", "Testing bad input parameter conditions");
+
+    params->stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    params->maskVal = 1;
+    params->fracLow = 0.0;
+    params->fracHigh = 10000.0;
+    params->nKeep = 0;
+
+    for (r=0;r<NUM_READOUTS;r++) {
+        baseRowsReadout[r] = 0;
+        baseColsReadout[r] = 0;
+        baseRows[r] = 0;
+        baseCols[r] = 0;
+        numRows[r] = INPUT_NUM_ROWS;
+        numCols[r] = INPUT_NUM_COLS;
+
+        psImage *tmpImage = psImageAlloc(numCols[r], numRows[r], PS_TYPE_F32);
+        PS_IMAGE_SET_F32(tmpImage, ((float) r));
+        *(int *) (& (tmpImage->row0)) = baseRows[r];
+        *(int *) (& (tmpImage->col0)) = baseCols[r];
+        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
+        tmpReadout->row0 = 0;
+        tmpReadout->col0 = 0;
+        tmpReadout->image = tmpImage;
+        minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r]));
+        minOutCol = PS_MIN(minOutCol, (baseColsReadout[r] + baseCols[r]));
+        maxOutRow = PS_MAX(maxOutRow, (baseRowsReadout[r] + baseRows[r] + numRows[r]));
+        maxOutCol = PS_MAX(maxOutCol, (baseColsReadout[r] + baseCols[r] + numCols[r]));
+
+        if (r == 0) {
+            list = psListAlloc(tmpReadout);
+        } else {
+            psListAdd(list, PS_LIST_HEAD, tmpReadout);
+        }
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with NULL zero vector.\n");
+    rc = pmReadoutCombine(NULL, list, params, NULL, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        psF32 NR = (psF32) NUM_READOUTS;
+        psF32 expectedPixel = ((NR/2.0) * (0.0 + (0.0 + VEC_SCALE * (NR - 1)))) / NR;
+        if (false == VerifyTheOutput(rc, expectedPixel)) {
+            testStatus = false;
+        }
+
+        if (rc->type.type != scale->type.type) {
+            printf("TEST ERROR: output readout->image has incorrect type.\n");
+            testStatus = false;
+        }
+        psFree(rc);
+    } else {
+        printf("TEST ERROR: pmReadoutCombine() returned NULL\n");
+        testStatus = false;
+
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect length zero vector (too small).  Should generate error.\n");
+    rc = pmReadoutCombine(NULL, list, params, zeroHalf, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect type zero vector.  Should generate error.\n");
+    rc = pmReadoutCombine(NULL, list, params, zeroF64, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect length zero vector (too big).  Should generate warning.\n");
+    rc = pmReadoutCombine(output, list, params, zeroBig, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        psF32 NR = (psF32) NUM_READOUTS;
+        psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR;
+
+        if (false == VerifyTheOutput(rc, expectedPixel)) {
+            testStatus = false;
+        }
+        psFree(rc);
+        rc = NULL;
+    } else {
+        printf("TEST ERROR: pmReadoutCombine() returned NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with NULL scale vector.\n");
+    rc = pmReadoutCombine(output, list, params, zero, NULL, true, 0.0, 0.0);
+
+    if (rc != NULL) {
+        psF32 NR = (psF32) NUM_READOUTS;
+        psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + 1.0 * (NR - 1)))) / NR;
+        if (false == VerifyTheOutput(rc, expectedPixel)) {
+            testStatus = false;
+        }
+
+        if (rc->type.type != scale->type.type) {
+            printf("TEST ERROR: output readout->image has incorrect type.\n");
+            testStatus = false;
+        }
+        psFree(rc);
+    } else {
+        printf("TEST ERROR: pmReadoutCombine() returned NULL\n");
+        testStatus = false;
+
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect length scale vector (too small).  Should generate error.\n");
+    rc = pmReadoutCombine(output, list, params, zero, scaleHalf, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect type scale vector.  Should generate error.\n");
+    rc = pmReadoutCombine(output, list, params, zero, scaleF64, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with incorrect length scale vector (too big).  Should generate warning.\n");
+    rc = pmReadoutCombine(output, list, params, zero, scaleBig, true, 0.0, 0.0);
+    if (rc != NULL) {
+        psF32 NR = (psF32) NUM_READOUTS;
+        psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR;
+
+        if (false == VerifyTheOutput(rc, expectedPixel)) {
+            testStatus = false;
+        }
+        psFree(rc);
+        rc = NULL;
+    } else {
+        printf("TEST ERROR: pmReadoutCombine() returned NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() insufficient size output image.  Should generate error, return NULL.\n");
+    output = psImageAlloc(1, 1, PS_TYPE_F32);
+    rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+    psFree(output);
+    output = NULL;
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() row0/col0 too large.  Should generate error, return NULL.\n");
+    output = psImageAlloc(1, 1, PS_TYPE_F32);
+    *(psS32*)&output->row0 = 10000;
+    *(psS32*)&output->col0 = 10000;
+    rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+    psFree(output);
+    output = NULL;
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with NULL input list.  Should generate error, return NULL.\n");
+    rc = pmReadoutCombine(output, NULL, params, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("Calling pmReadoutCombine() with NULL params.  Should generate error, return NULL.\n");
+    rc = pmReadoutCombine(output, list, NULL, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------\n");
+    psStatsOptions oldStatsOpts = params->stats->options |= PS_STAT_MIN;
+    printf("Calling pmReadoutCombine() with multiple stats->options.  Should generate error, return NULL.\n");
+    rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+    params->stats->options = oldStatsOpts;
+
+    printf("----------------------------------------------------------------------------\n");
+    psStats *oldStats = params->stats;
+    printf("Calling pmReadoutCombine() with NULL param->stats.  Should generate error, return NULL.\n");
+    params->stats = NULL;
+    rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmReadoutCombine() did not return NULL\n");
+        testStatus = false;
+    }
+    params->stats = oldStats;
+
+    printf("----------------------------------------------------------------------------\n");
+    printf("============================================================================\n");
+
+    psFree(params->stats);
+    psFree(params);
+    //    psFree(output);
+    //    psFree(rc);
+    psFree(zero);
+    psFree(zeroHalf);
+    psFree(zeroBig);
+    psFree(zeroF64);
+    psFree(scale);
+    psFree(scaleHalf);
+    psFree(scaleBig);
+    psFree(scaleF64);
+    psListElem *tmpInput = (psListElem *) list->head;
+    while (NULL != tmpInput) {
+        pmReadout *tmpReadout = (pmReadout *) tmpInput->data;
+        psFree(tmpReadout);
+        tmpInput = tmpInput->next;
+    }
+    psFree(list);
+
+    printFooter(stdout, "pmReadoutCombine", "Testing bad input parameter conditions", true);
+    return(testStatus);
+}
Index: /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stderr
===================================================================
--- /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stderr	(revision 5169)
+++ /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stderr	(revision 5169)
@@ -0,0 +1,25 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmImageCombine.c                                       *
+*            TestPoint: Test Point Driver{pmCombineImages()}                       *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    Unallowable operation: images is NULL.
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    images and errors args must have same length (6 != 5)
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    Unallowable operation: psImage tmpDataImg has incorrect type.
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    images and errors args must have same length (5 != 6)
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    Unallowable operation: psImage tmpErrorImg has incorrect type.
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    images and masks args must have same length (5 != 6)
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    Unallowable operation: psImage tmpMaskImg has incorrect type.
+<HOST>|E|pmCombineImages (FILE:LINENO)
+    Unallowable operation: stats is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmCombineImages()} | tst_pmImageCombine.c)
+
Index: /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stdout
===================================================================
--- /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stdout	(revision 5169)
+++ /trunk/psModules/test/imcombine/verified/tst_pmImageCombine.stdout	(revision 5169)
@@ -0,0 +1,47 @@
+Testing pmCombineImages(10, 10, 5)
+Generating a bad pixel in image (1) at (0, 8)
+Generating a bad pixel in image (3) at (7, 5)
+Generating a bad pixel in image (1) at (1, 2)
+Generating a bad pixel in image (2) at (9, 9)
+Generating a bad pixel in image (1) at (3, 9)
+Generating a bad pixel in image (2) at (0, 5)
+Generating a bad pixel in image (1) at (4, 5)
+Generating a bad pixel in image (1) at (3, 8)
+Generating a bad pixel in image (2) at (6, 2)
+Generating a bad pixel in image (2) at (3, 7)
+Calling with a NULL images.  Should generate error, return NULL.
+Calling with a long images.  Should generate error, return NULL.
+Calling with a bad type images.  Should generate error, return NULL.
+Calling with a long errors.  Should generate error, return NULL.
+Calling with a bad type errors.  Should generate error, return NULL.
+Calling with a long masks.  Should generate error, return NULL.
+Calling with a bad type masks.  Should generate error, return NULL.
+Calling with a NULL stats.  Should generate error, return NULL.
+Calling with acceptable data.  Should generate a psImage.
+Image 1, questionable pixel 0 is (0 8)
+Image 1, questionable pixel 1 is (1 2)
+Image 1, questionable pixel 2 is (3 9)
+Image 1, questionable pixel 3 is (4 5)
+Image 1, questionable pixel 4 is (3 8)
+Image 2, questionable pixel 0 is (9 9)
+Image 2, questionable pixel 1 is (0 5)
+Image 2, questionable pixel 2 is (6 2)
+Image 2, questionable pixel 3 is (3 7)
+Image 3, questionable pixel 0 is (7 5)
+
+
+
+Calling pmRejectPixels() with acceptable data.  Should generate a psArray.
+tst_pmImageCombine.c: Image 0 had 0 rejects.
+tst_pmImageCombine.c: Image 1 had 4 rejects.
+Image 1, rejected pixel 0 is (0 8)
+Image 1, rejected pixel 1 is (1 2)
+Image 1, rejected pixel 2 is (4 5)
+Image 1, rejected pixel 3 is (3 8)
+tst_pmImageCombine.c: Image 2 had 3 rejects.
+Image 2, rejected pixel 0 is (0 5)
+Image 2, rejected pixel 1 is (6 2)
+Image 2, rejected pixel 2 is (3 7)
+tst_pmImageCombine.c: Image 3 had 1 rejects.
+Image 3, rejected pixel 0 is (7 5)
+tst_pmImageCombine.c: Image 4 had 0 rejects.
Index: /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stderr
===================================================================
--- /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stderr	(revision 5169)
+++ /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stderr	(revision 5169)
@@ -0,0 +1,42 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: Test Point Driver{pmSubtractBias(): Basic readout combines with no image overla *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias(): Basic readout combines with no image overlap} | tst_pmReadoutCombine.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: Test Point Driver{pmSubtractBias(): input parameter error conditions} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    zero vector has incorrect size (5).  Returning NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Unallowable operation: psVector zero has incorrect type.
+<HOST>|W|pmReadoutCombine
+    WARNING: the zero vector too many elements (11)
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    scale vector has incorrect size (5).  Returning NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Unallowable operation: psVector scale has incorrect type.
+<HOST>|W|pmReadoutCombine
+    WARNING: the scale vector has too many elements (20)
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Output image (1, 1) is too small to hold combined images.  Returning NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Output image offset is larger then input image offset.  Returning NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Unallowable operation: inputs is NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Unallowable operation: params is NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Multiple statistical options have been requested.  Returning NULL.
+<HOST>|E|pmReadoutCombine (FILE:LINENO)
+    Unallowable operation: params->stats is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias(): input parameter error conditions} | tst_pmReadoutCombine.c)
+
Index: /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stdout
===================================================================
--- /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stdout	(revision 5169)
+++ /trunk/psModules/test/imcombine/verified/tst_pmReadoutCombine.stdout	(revision 5169)
@@ -0,0 +1,79 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (1, 1)
+
+---> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (1, 20)
+
+---> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (20, 1)
+
+---> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (20, 20)
+
+---> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmReadoutCombine.c                                     *
+*            TestPoint: pmReadoutCombine{Testing bad input parameter conditions}   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with NULL zero vector.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect length zero vector (too small).  Should generate error.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect type zero vector.  Should generate error.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect length zero vector (too big).  Should generate warning.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with NULL scale vector.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect length scale vector (too small).  Should generate error.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect type scale vector.  Should generate error.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with incorrect length scale vector (too big).  Should generate warning.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() insufficient size output image.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() row0/col0 too large.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with NULL input list.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with NULL params.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with multiple stats->options.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+Calling pmReadoutCombine() with NULL param->stats.  Should generate error, return NULL.
+----------------------------------------------------------------------------
+============================================================================
+
+---> TESTPOINT PASSED (pmReadoutCombine{Testing bad input parameter conditions} | tst_pmReadoutCombine.c)
+
Index: /trunk/psModules/test/imsubtract/Makefile.am
===================================================================
--- /trunk/psModules/test/imsubtract/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/imsubtract/Makefile.am	(revision 5169)
@@ -0,0 +1,26 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+AM_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS)
+
+TESTS = \
+    tst_pmImageSubtract \
+    tst_pmSubtractBias \
+    tst_pmSubtractSky
+
+tst_pmImageSubtract_SOURCES = tst_pmImageSubtract.c
+tst_pmSubstractBias_SOURCES = tst_pmSubstractBias.c
+tst_pmSubstractSky_SOURCES = tst_pmSubstractSky.c
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/imsubtract/tst_pmImageSubtract.c
===================================================================
--- /trunk/psModules/test/imsubtract/tst_pmImageSubtract.c	(revision 5169)
+++ /trunk/psModules/test/imsubtract/tst_pmImageSubtract.c	(revision 5169)
@@ -0,0 +1,843 @@
+/** @file tst_pmImageSubtract.c
+ *
+ *  @brief Contains the tests for pmImageSubtract.c:
+ *
+ *  test00: This code will test the various functions in pmObjects.c
+ *
+ *  @author GLG, MHPCC
+ *
+ *  XXX: Most test simply ensure that the functions can be called with allowable
+ *  data.  More work need to be done to verify the results.
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+#include "psTest.h"
+#include "pslib.h"
+#include "pmImageSubtract.h"
+#define ERROR_TOLERANCE 1.0
+static int test00(void);
+static int test01(void);
+static int test02(void);
+static int test03(void);
+testDescription tests[] = {
+                              {test00, 000, "pmSubtractionKernelsAllocPOIS()", true, false},
+                              {test01, 000, "pmSubtractionKernelsAllocISIS()", true, false},
+                              {test02, 000, "pmSubtractionFindStamps()", true, false},
+                              {test03, 000, "pmSubtractionCalculateEquation()", true, false},
+                              {NULL}
+                          };
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+
+/*******************************************************************************
+NOTE: This function returns FALSE if there were no errors.
+ 
+XXX: Call with various unallowable input parameters.
+ 
+XXX: Untested: we don't loop through the (u, v, xOrder, yOrder) psVectors and
+ensure that each value is set correctly.
+ ******************************************************************************/
+psBool testPOISAlloc(psS32 size,
+                     psS32 SpatialOrder)
+{
+    printf("Testing pmSubtractionKernelsAllocPOIS(%d, %d)\n", size, SpatialOrder);
+
+    bool testStatus = false;
+    psS32 nBasisFunctions = (2 * size + 1) * (2 * size + 1) * (SpatialOrder + 1) * (SpatialOrder + 2) / 2;
+
+    psSubtractionKernels *kernels = pmSubtractionKernelsAllocPOIS(size, SpatialOrder);
+    if (kernels == NULL) {
+        printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() returned a NULL psSubtractionKernels.\n");
+        testStatus = true;
+    } else {
+        if (kernels->type != PM_SUBTRACTION_KERNEL_POIS) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated the wrong kernels->type.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->u == NULL) ||
+                (kernels->u->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a NULL ->u member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a incorrect length ->u member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->v == NULL) ||
+                (kernels->v->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a NULL ->v member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a incorrect length ->v member.\n");
+            testStatus = true;
+        }
+
+        if (kernels->sigma != NULL) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a non-NULL ->sigma member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->xOrder == NULL) ||
+                (kernels->xOrder->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a NULL ->xOrder member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a incorrect length ->xOrder member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->yOrder == NULL) ||
+                (kernels->yOrder->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a NULL ->yOrder member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a incorrect length ->yOrder member.\n");
+            testStatus = true;
+        }
+
+        if (kernels->subIndex != 0) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a non-zero ->subIndex member (%d).\n", kernels->subIndex);
+            testStatus = true;
+        }
+
+        psS32 i = kernels->subIndex;
+        if ((kernels->u->data.F32[i] != 0) ||
+                (kernels->v->data.F32[i] != 0)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS(): the ->subIndex member points to a kernel with (%f, %f) (u, v) basis function.\n",
+                   kernels->u->data.F32[i], kernels->v->data.F32[i]);
+            testStatus = true;
+        }
+
+        if (kernels->preCalc != NULL) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated a non-NULL ->preCalc member.\n");
+            testStatus = true;
+        }
+
+        if (kernels->size != size) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated an incorrect ->size member (%d).\n", kernels->size);
+            testStatus = true;
+        }
+
+        if (kernels->spatialOrder != SpatialOrder) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocPOIS() generated an incorrect ->spatialOrder member (%d).\n", kernels->spatialOrder);
+            testStatus = true;
+        }
+    }
+    psFree(kernels);
+    return(testStatus);
+}
+
+/*******************************************************************************
+NOTE: This function returns TRUE if there were no errors.
+ ******************************************************************************/
+int test00( void )
+{
+    bool testStatus = false;
+
+    testStatus|= testPOISAlloc(1, 1);
+    testStatus|= testPOISAlloc(2, 3);
+    testStatus|= testPOISAlloc(3, 4);
+
+    return(!testStatus);
+}
+
+/*******************************************************************************
+NOTE: This function returns FALSE if there were no errors.
+ 
+XXX: Call with various unallowable input parameters.
+ 
+XXX: Untested: we don't loop through the (u, v, xOrder, yOrder) psVectors and
+ensure that each value is set correctly.  We don't ensure that he preCalc
+psImages are set correctly.
+ ******************************************************************************/
+psBool testISISAlloc(psS32 sigmaLength,
+                     psS32 orderLength,
+                     psS32 size,
+                     psS32 SpatialOrder)
+{
+    printf("Testing pmSubtractionKernelsAllocISIS(%d, %d, %d, %d)\n",
+           sigmaLength, orderLength, size, SpatialOrder);
+
+    psVector *sigmas = psVectorAlloc(sigmaLength, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < sigmas->n ; i++) {
+        sigmas->data.F32[i] = 1.0 + (psF32) i;
+    }
+    psVector *orders = psVectorAlloc(orderLength, PS_TYPE_S32);
+    for (psS32 i = 0 ; i < orders->n ; i++) {
+        orders->data.S32[i] = i + 2;
+    }
+
+    bool testStatus = false;
+    psS32 numSigmas = sigmas->n;
+    psS32 nBasisFunctions = 0;
+    for (psS32 s = 0 ; s < numSigmas ; s++) {
+        for (psS32 o = 0 ; o < orders->n ; o++) {
+            nBasisFunctions+= ((orders->data.S32[o] + 1) * (orders->data.S32[o] + 2) / 2);
+        }
+    }
+    nBasisFunctions*= ((SpatialOrder + 1) * (SpatialOrder + 2) / 2);
+
+    psSubtractionKernels *kernels = pmSubtractionKernelsAllocISIS(sigmas, orders, size, SpatialOrder);
+    if (kernels == NULL) {
+        printf("TEST ERROR: pmSubtractionKernelsAllocISIS() returned a NULL psSubtractionKernels.\n");
+        testStatus = true;
+    } else {
+        if (kernels->type != PM_SUBTRACTION_KERNEL_ISIS) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated the wrong kernels->type.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->u == NULL) ||
+                (kernels->u->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->u member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->u member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->v == NULL) ||
+                (kernels->v->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->v member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->v member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->sigma == NULL) ||
+                (kernels->sigma->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->sigma member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->sigma member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->xOrder == NULL) ||
+                (kernels->xOrder->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->xOrder member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->xOrder member.\n");
+            testStatus = true;
+        }
+
+        if ((kernels->yOrder == NULL) ||
+                (kernels->yOrder->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->yOrder member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->yOrder member.\n");
+            testStatus = true;
+        }
+
+        if (kernels->subIndex != 0) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a non-zero ->subIndex member (%d).\n", kernels->subIndex);
+            testStatus = true;
+        }
+
+        //
+        // Ensure that kernels->subIndex points to the correct kernel.
+        //
+        psS32 i = kernels->subIndex;
+        if ((kernels->u->data.F32[i] != 0.0) ||
+                (kernels->v->data.F32[i] != 0.0) ||
+                (kernels->xOrder->data.F32[i] != 0.0) ||
+                (kernels->yOrder->data.F32[i] != 0.0) ||
+                (kernels->sigma->data.F32[i] != sigmas->data.F32[0])) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS(): the ->subIndex member points to the wrong kernel.\n");
+            printf("TEST ERROR: (u, v, xOrder, yOrder, sigma) is (%f, %f, %f, %f, %f).\n",
+                   kernels->u->data.F32[i], kernels->v->data.F32[i],
+                   kernels->xOrder->data.F32[i], kernels->yOrder->data.F32[i],
+                   kernels->sigma->data.F32[i]);
+            testStatus = true;
+        }
+
+        //
+        // Ensure that the preCalc images are allocated correctly.
+        //
+        if ((kernels->preCalc == NULL) ||
+                (kernels->preCalc->n != nBasisFunctions)) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a NULL ->preCalc member or\n");
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated a incorrect length ->preCalc member.\n");
+            testStatus = true;
+        } else {
+            for (psS32 k = 0 ; k < kernels->u->n ; k++) {
+                psImage *kerImg = (psImage *) kernels->preCalc->data[k];
+                if (kerImg == NULL) {
+                    printf("TEST ERROR: the %d-th kernel preCalc image is NULL.\n", k);
+                    testStatus = true;
+                } else {
+                    if (kerImg->type.type != PS_TYPE_F32) {
+                        printf("TEST ERROR: preCalc image %d had ioncorrect type.\n", k);
+                        testStatus = true;
+                    }
+                    if ((kerImg->numRows != (1 + (2 * size))) ||
+                            (kerImg->numCols != (1 + (2 * size)))) {
+                        printf("TEST ERROR: preCalc image %d had incorrect size (%d, %d).\n", k,
+                               kerImg->numRows, kerImg->numCols);
+                        testStatus = true;
+                    }
+                }
+            }
+        }
+
+        if (kernels->size != size) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated an incorrect ->size member (%d).\n", kernels->size);
+            testStatus = true;
+        }
+
+        if (kernels->spatialOrder != SpatialOrder) {
+            printf("TEST ERROR: pmSubtractionKernelsAllocISIS() generated an incorrect ->spatialOrder member (%d).\n", kernels->spatialOrder);
+            testStatus = true;
+        }
+    }
+    psFree(sigmas);
+
+    psFree(kernels->u);
+    psFree(kernels->v);
+    psFree(kernels->sigma);
+    psFree(kernels->xOrder);
+    psFree(kernels->yOrder);
+    psFree(kernels->preCalc);
+    psFree(kernels);
+    psFree(orders);
+    return(testStatus);
+}
+
+/*******************************************************************************
+NOTE: This function returns TRUE if there were no errors.
+ ******************************************************************************/
+int test01( void )
+{
+    bool testStatus = false;
+
+    /*
+        testStatus|= testISISAlloc(1, 1, 1, 1);
+        testStatus|= testISISAlloc(2, 2, 2, 2);
+        testStatus|= testISISAlloc(2, 3, 4, 5);
+        testStatus|= testISISAlloc(3, 4, 5, 6);
+    */
+
+    return(!testStatus);
+}
+
+
+/*******************************************************************************
+NOTE: This function returns FALSE if there were no errors.
+ 
+XXX: Can we test to ensure that no stamps overlap?
+ 
+XXX: Test stamp alloc/dealloc functions.
+ ******************************************************************************/
+#define TST02_THRESHOLD 3.0
+#define TST02_MASK_VAL 1
+psBool testFindStamps(psS32 numCols,
+                      psS32 numRows,
+                      psS32 xNum,
+                      psS32 yNum,
+                      psS32 border)
+{
+    printf("Testing pmSubtractionFindStamps(%d, %d, %d, %d, %d)\n",
+           numCols, numRows, xNum, yNum, border);
+    bool testStatus = false;
+
+    // Create a test image and set a single pixel in the center of each stamp.
+    psImage *tstImg = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    int numStamps = 0;
+    PS_IMAGE_SET_F32(tstImg, 0.0);
+    for (psS32 j = 0; j < yNum; j++) {
+        for (psS32 i = 0; i < xNum; i++) {
+            psS32 yMin = border + j * (numRows - 2.0 * border) / yNum;
+            psS32 yMax = PS_MIN(numRows-1, (border + (j + 1) * (numRows - 2.0 * border) / yNum) - 1);
+            psS32 xMin = border + i * (numCols - 2.0 * border) / xNum;
+            psS32 xMax = PS_MIN(numCols-1, (border + (i + 1) * (numCols - 2.0 * border) / xNum) - 1);
+
+            tstImg->data.F32[(yMax+yMin)/2][(xMax+xMin)/2] = TST02_THRESHOLD + (psF32) (i + j);
+            numStamps++;
+        }
+    }
+    psImage *tmpMask= psImageAlloc(numCols, numRows, PS_TYPE_U8);
+    PS_IMAGE_SET_U8(tstImg, 0);
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a NULL psImage.  Should generate error, return NULL.\n");
+    psArray *stamps = pmSubtractionFindStamps(NULL, NULL, tmpMask, TST02_MASK_VAL,
+                      TST02_THRESHOLD, xNum, yNum,
+                      border);
+    if (stamps != NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        psFree(stamps);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a non-positive xNum.  Should generate error, return NULL.\n");
+    stamps = pmSubtractionFindStamps(NULL, tstImg, tmpMask, TST02_MASK_VAL,
+                                     TST02_THRESHOLD, 0, yNum,
+                                     border);
+    if (stamps != NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        psFree(stamps);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a non-positive yNum.  Should generate error, return NULL.\n");
+    stamps = pmSubtractionFindStamps(NULL, tstImg, tmpMask, TST02_MASK_VAL,
+                                     TST02_THRESHOLD, xNum, 0,
+                                     border);
+    if (stamps != NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        psFree(stamps);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with a non-positive border.  Should generate error, return NULL.\n");
+    stamps = pmSubtractionFindStamps(NULL, tstImg, tmpMask, TST02_MASK_VAL,
+                                     TST02_THRESHOLD, xNum, yNum,
+                                     0);
+    if (stamps != NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        psFree(stamps);
+        testStatus = true;
+    }
+
+    //-------------------------------------------------------------------------
+    printf("Calling with acceptable input parameters, non-NULL mask.\n");
+    stamps = pmSubtractionFindStamps(NULL, tstImg, tmpMask, TST02_MASK_VAL,
+                                     TST02_THRESHOLD, xNum, yNum,
+                                     border);
+    if (stamps == NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        testStatus = true;
+    } else {
+        if (stamps->n != numStamps) {
+            printf("TEST ERROR: %ld stamps were found, %d were expected.\n",
+                   stamps->n, numStamps);
+            testStatus = true;
+        }
+        for (psS32 s = 0 ; s < stamps->n ; s++) {
+            pmStamp *stamp = (pmStamp *) stamps->data[s];
+            psS32 row = stamp->y;
+            psS32 col = stamp->x;
+            // printf("Stamp %d at (%d, %d) has a value of %f\n", s, row, col, tstImg->data.F32[row][col]);
+            if (tstImg->data.F32[row][col] < TST02_THRESHOLD) {
+                if (stamp->status != PM_STAMP_NONE) {
+                    printf("TEST ERROR: stamp %d had peak value %f (below theshold) and the status was not set to PM_STAMP_NONE.\n",
+                           s, tstImg->data.F32[row][col]);
+                    testStatus = true;
+                }
+            } else {
+                if (stamp->status != PM_STAMP_RECALC) {
+                    printf("TEST ERROR: stamp %d had peak value %f (above theshold) and the status was not set to PM_STAMP_RECALC.\n",
+                           s, tstImg->data.F32[row][col]);
+                    testStatus = true;
+                }
+            }
+        }
+    }
+    psFree(stamps);
+
+    //-------------------------------------------------------------------------
+    printf("Calling with acceptable input parameters, NULL mask.\n");
+    stamps = pmSubtractionFindStamps(NULL, tstImg, NULL, TST02_MASK_VAL,
+                                     TST02_THRESHOLD, xNum, yNum,
+                                     border);
+    if (stamps == NULL) {
+        printf("TEST ERROR: pmSubtractionFindStamps returned a non-NULL psArray.\n");
+        testStatus = true;
+    } else {
+        if (stamps->n != numStamps) {
+            printf("TEST ERROR: %ld stamps were found, %d were expected.\n",
+                   stamps->n, numStamps);
+            testStatus = true;
+        }
+        for (psS32 s = 0 ; s < stamps->n ; s++) {
+            pmStamp *stamp = (pmStamp *) stamps->data[s];
+            psS32 row = stamp->y;
+            psS32 col = stamp->x;
+            //printf("Stamp %d at (%d, %d) has a value of %f\n", s, row, col, tstImg->data.F32[row][col]);
+            if (tstImg->data.F32[row][col] < TST02_THRESHOLD) {
+                if (stamp->status != PM_STAMP_NONE) {
+                    printf("TEST ERROR: stamp %d had peak value %f (below theshold) and the status was not set to PM_STAMP_NONE.\n",
+                           s, tstImg->data.F32[row][col]);
+                    testStatus = true;
+                }
+            } else {
+                if (stamp->status != PM_STAMP_RECALC) {
+                    printf("TEST ERROR: stamp %d had peak value %f (above theshold) and the status was not set to PM_STAMP_RECALC.\n",
+                           s, tstImg->data.F32[row][col]);
+                    testStatus = true;
+                }
+            }
+        }
+    }
+
+    psFree(tstImg);
+    psFree(tmpMask);
+    psFree(stamps);
+
+    return(testStatus);
+}
+
+
+
+/*******************************************************************************
+NOTE: This function returns TRUE if there were no errors.
+ ******************************************************************************/
+int test02( void )
+{
+    bool testStatus = false;
+
+    testStatus|= testFindStamps(100, 100, 2, 2, 2);
+    testStatus|= testFindStamps(100, 100, 10, 10, 2);
+
+    return(!testStatus);
+}
+
+
+psF32 genRanFloat(psF32 low,
+                  psF32 high)
+{
+    psF32 ran1 = (((psF32) (random() % 10000)) / 10000.0);
+    return(low + (ran1 * (high - low)));
+}
+
+//
+// XXX: POIS kernels are producing NANs if the image size is 20 or less.
+//
+// XXX: ISIS kernels are producing NANS if the TST03_ORDER_LENGTH is 2 or larger.
+//
+#define TST03_THRESHOLD  3.0
+#define TST03_MASK_VAL  1
+#define TST03_KERNEL_SIZE 2
+#define TST03_SPATIAL_ORDER 2
+#define TST03_ORDER_LENGTH 1
+#define TST03_SIGMA_LENGTH 1
+#define TST03_PSF_MAX  10.0
+#define TST03_BG 0.0
+#define TST03_IMAGE_SIZE 25
+#define TST03_NUM_COLS  TST03_IMAGE_SIZE
+#define TST03_NUM_ROWS  TST03_IMAGE_SIZE
+#define TST03_NUM_STAMPS 2
+#define TST03_NUM_STAMPS_COLS TST03_NUM_STAMPS
+#define TST03_NUM_STAMPS_ROWS TST03_NUM_STAMPS
+#define TST03_BORDER  TST03_KERNEL_SIZE
+//#define TST03_FOOTPRINT (((TST03_IMAGE_SIZE - (2 * TST03_BORDER)) / TST03_NUM_STAMPS) - TST03_KERNEL_SIZE)
+#define TST03_FOOTPRINT  4
+#define TST03_PSF_WIDTH  (TST03_FOOTPRINT/2 - 1)
+
+/*******************************************************************************
+This routine generates an object in the center of the stamp defined by the
+(xMin, xMax) and (yMin, yMax) boundary.
+ ******************************************************************************/
+psBool genObject(psImage *tstImg,
+                 psImage *refImg,
+                 psS32 xMin,
+                 psS32 xMax,
+                 psS32 yMin,
+                 psS32 yMax)
+{
+    if (((1 + 2 * TST03_PSF_WIDTH) > (xMax - xMin)) ||
+            ((1 + 2 * TST03_PSF_WIDTH) > (yMax - yMin))) {
+        printf("INCORRECT TEST CONFIGURATION: TST03_PSF_WIDTH is too big.\n");
+        printf("TST03_PSF_WIDTH is %d: (xMin - xMax) is %d\n", TST03_PSF_WIDTH, (xMax - xMin));
+        return(FALSE);
+    }
+    //
+    // This code basically creates a peak at the center of the stamp with
+    // a height of TST03_PSF_MAX
+    //
+    psS32 xCenter = (xMax + xMin) / 2;
+    psS32 yCenter = (yMax + yMin) / 2;
+    psF32 subImageWidth = 1.0 + sqrtf(PS_SQR(((psF32) ((yMax-yMin)/2))) + PS_SQR(((psF32) ((xMax-xMin)/2))));
+    for (psS32 y = yMin ; y <= yMax ; y++) {
+        for (psS32 x = xMin ; x <= xMax ; x++) {
+            psF32 dist = sqrtf(PS_SQR((psF32) (y - yCenter)) + PS_SQR((psF32) (x - xCenter)));
+            psF32 pixel = TST03_PSF_MAX * PS_SQR(((psF32) (subImageWidth - dist)) / ((psF32) subImageWidth));
+            if (pixel < 0.0) {
+                pixel = 0.0;
+            }
+            refImg->data.F32[y][x] = pixel + TST03_BG;
+            tstImg->data.F32[y][x] = pixel + TST03_BG;
+            // Add some noise for the test image.
+            tstImg->data.F32[y][x]+= genRanFloat(0.0, 1.0);
+        }
+    }
+
+    return(TRUE);
+}
+
+/*******************************************************************************
+NOTE: This function returns FALSE if there were no errors.
+ 
+XXX: We should use a larger variety of input parameter configurations.
+ 
+I test the following functions here (since they linearly rely on a set of data
+structures that the previoues ones generate):
+    pmSubtractionCalculateEquation()
+    pmSubtractionSolveEquation()
+    pmSubtractionRejectStamps()
+    pmSubtractionKernelImage()
+ ******************************************************************************/
+psBool testSubCalcEqu(psS32 numCols,
+                      psS32 numRows,
+                      psS32 xNum,
+                      psS32 yNum,
+                      psS32 border,
+                      pmSubtractionKernelsType KernelType)
+{
+    printf("Testing pmSubtractionCalculateEquation(): \n");
+    printf("    image size is (%d, %d)\n", numRows, numCols);
+    printf("    num stamps is (%d, %d).  Border is %d\n", yNum, xNum, border);
+    if (KernelType == PM_SUBTRACTION_KERNEL_POIS) {
+        printf("   kernel type is PM_SUBTRACTION_KERNEL_POIS.\n");
+    } else if (KernelType == PM_SUBTRACTION_KERNEL_ISIS) {
+        printf("   kernel type is PM_SUBTRACTION_KERNEL_ISIS.\n");
+    }
+    bool testStatus = false;
+
+    // Create a test image and set a single pixel in the center of each stamp.
+    psImage *tstImg = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *refImg = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *maskImg = psImageAlloc(numCols, numRows, PS_TYPE_U8);
+    PS_IMAGE_SET_F32(tstImg, 0.0);
+    PS_IMAGE_SET_F32(maskImg, 0);
+    for (psS32 j = 0; j < yNum; j++) {
+        for (psS32 i = 0; i < xNum; i++) {
+            psS32 yMin = border + j * (numRows - 2.0 * border) / yNum;
+            psS32 yMax = PS_MIN(numRows-1, (border + (j + 1) * (numRows - 2.0 * border) / yNum) - 1);
+            psS32 xMin = border + i * (numCols - 2.0 * border) / xNum;
+            psS32 xMax = PS_MIN(numCols-1, (border + (i + 1) * (numCols - 2.0 * border) / xNum) - 1);
+
+            genObject(tstImg, refImg, xMin, xMax, yMin, yMax);
+        }
+    }
+    printf("Generating stamps...\n");
+    psArray *stamps = pmSubtractionFindStamps(NULL, tstImg, NULL, TST03_MASK_VAL,
+                      TST03_THRESHOLD, xNum, yNum,
+                      border);
+
+    //
+    // PsVectors sigmas and orders are for ISIS kernels only.
+    //
+    psVector *sigmas = psVectorAlloc(TST03_SIGMA_LENGTH, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < sigmas->n ; i++) {
+        sigmas->data.F32[i] = 1.0 + (psF32) i;
+    }
+    psVector *orders = psVectorAlloc(TST03_ORDER_LENGTH, PS_TYPE_S32);
+    for (psS32 i = 0 ; i < orders->n ; i++) {
+        orders->data.S32[i] = i + 2;
+    }
+
+    //
+    // Create the subtraction kernels
+    //
+    printf("Generating kernel basis functions...\n");
+    psSubtractionKernels *myKernels = NULL;
+    if (KernelType == PM_SUBTRACTION_KERNEL_POIS) {
+        myKernels = pmSubtractionKernelsAllocPOIS(TST03_KERNEL_SIZE, TST03_SPATIAL_ORDER);
+    } else if (KernelType == PM_SUBTRACTION_KERNEL_ISIS) {
+        myKernels = pmSubtractionKernelsAllocISIS(sigmas, orders, TST03_KERNEL_SIZE, TST03_SPATIAL_ORDER);
+    }
+
+    if ((stamps == NULL) ||
+            (myKernels == NULL)) {
+        printf("TEST ERROR: stamps or myKernels is NULL.\n");
+        testStatus = true;
+    } else {
+        //-------------------------------------------------------------------------
+        printf("Calling with a NULL psArray stamps.  Should generate error, return FALSE.\n");
+        psBool rc = pmSubtractionCalculateEquation(NULL, refImg, tstImg, myKernels, TST03_FOOTPRINT);
+        if (rc == TRUE) {
+            printf("TEST ERROR: pmSubtractionCalculateEquation() returned TRUE.\n");
+            testStatus = true;
+        }
+
+        //-------------------------------------------------------------------------
+        printf("Calling with a NULL reference images.  Should generate error, return FALSE.\n");
+        rc = pmSubtractionCalculateEquation(stamps, NULL, tstImg, myKernels, TST03_FOOTPRINT);
+        if (rc == TRUE) {
+            printf("TEST ERROR: pmSubtractionCalculateEquation() returned TRUE.\n");
+            testStatus = true;
+        }
+
+        //-------------------------------------------------------------------------
+        printf("Calling with a NULL input images.  Should generate error, return FALSE.\n");
+        rc = pmSubtractionCalculateEquation(stamps, refImg, NULL, myKernels, TST03_FOOTPRINT);
+        if (rc == TRUE) {
+            printf("TEST ERROR: pmSubtractionCalculateEquation() returned TRUE.\n");
+            testStatus = true;
+        }
+
+        //-------------------------------------------------------------------------
+        printf("Calling with a NULL kernel basis functions.  Should generate error, return FALSE.\n");
+        rc = pmSubtractionCalculateEquation(stamps, refImg, tstImg, NULL, TST03_FOOTPRINT);
+        if (rc == TRUE) {
+            printf("TEST ERROR: pmSubtractionCalculateEquation() returned TRUE.\n");
+            testStatus = true;
+        }
+
+        //-------------------------------------------------------------------------
+        printf("Calling with acceptable input parameters.  Should return TRUE.\n");
+
+        rc = pmSubtractionCalculateEquation(stamps, refImg, tstImg, myKernels, TST03_FOOTPRINT);
+        if (rc != TRUE) {
+            printf("TEST ERROR: pmSubtractionCalculateEquation() returned FALSE.\n");
+            testStatus = true;
+        } else {
+
+            if (0) {
+                for (psS32 s = 0 ; s < stamps->n ; s++) {
+                    printf("********************************* Stamp %d *********************************\n", s);
+                    pmStamp *stamp = (pmStamp *) stamps->data[s];
+                    if (stamp->vector != NULL) {
+                        PS_VECTOR_PRINT_F64(stamp->vector);
+                    }
+                    if (stamp->matrix != NULL) {
+                        printf("Stamp matrix size is (%d, %d)\n", stamp->matrix->numRows, stamp->matrix->numCols);
+                        PS_IMAGE_PRINT_F64(stamp->matrix);
+                    }
+                }
+            }
+
+
+            //-------------------------------------------------------------------------
+            printf("Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.\n");
+            psVector *solution = pmSubtractionSolveEquation(NULL, NULL);
+            if (solution != NULL) {
+                printf("TEST ERROR: pmSubtractionSolveEquation() returned non-NULL.\n");
+                testStatus = true;
+            }
+
+            //-------------------------------------------------------------------------
+            printf("Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.\n");
+            solution = pmSubtractionSolveEquation(NULL, stamps);
+            if (solution == NULL) {
+                printf("TEST ERROR: pmSubtractionSolveEquation() returned NULL.\n");
+                testStatus = true;
+            } else {
+                printf("The solution vector is:\n");
+                for (psS32 i = 0 ; i < solution->n ; i++) {
+                    printf("(%.2f) ", solution->data.F64[i]);
+                }
+                printf("\n");
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.\n");
+                rc = pmSubtractionRejectStamps(stamps, maskImg, 0xff, TST03_FOOTPRINT, 1.0, refImg,
+                                               tstImg, solution, myKernels);
+                if (rc != TRUE) {
+                    printf("TEST ERROR: pmSubtractionRejectStamps() returned FALSE.\n");
+                    testStatus = true;
+                } else {}
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.\n");
+                psImage *kernelImg = pmSubtractionKernelImage(NULL, NULL, myKernels, 0.0, 0.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, NULL, 0.0, 0.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, myKernels, -2.0, 0.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, myKernels, 2.0, 0.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, myKernels, 0.0, -2.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, myKernels, 0.0, 2.0);
+                if (kernelImg != NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned non-NULL.\n");
+                    testStatus = true;
+                }
+                free(kernelImg);
+
+                //-------------------------------------------------------------------------
+                printf("Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.\n");
+                kernelImg = pmSubtractionKernelImage(NULL, solution, myKernels, 0.5, 0.5);
+                if (kernelImg == NULL) {
+                    printf("TEST ERROR: pmSubtractionKernelImage() returned NULL.\n");
+                    testStatus = true;
+                } else {
+                    for (psS32 row = 0 ; row < kernelImg->numRows; row++) {
+                        for (psS32 col = 0 ; col < kernelImg->numCols; col++) {
+                            printf("%f ", kernelImg->data.F32[row][col]);
+                        }
+                        printf("\n");
+                    }
+                }
+                free(kernelImg);
+
+                psFree(solution);
+            }
+        }
+    }
+    psFree(tstImg);
+    psFree(refImg);
+    psFree(stamps);
+    psFree(myKernels);
+    psFree(orders);
+    psFree(sigmas);
+
+    return(testStatus);
+}
+
+/*******************************************************************************
+NOTE: This function returns TRUE if there were no errors.
+ ******************************************************************************/
+int test03( void )
+{
+    bool testStatus = false;
+
+
+    srand(1995);
+    if (1)
+        testStatus|= testSubCalcEqu(TST03_NUM_COLS,
+                                    TST03_NUM_ROWS,
+                                    TST03_NUM_STAMPS_COLS,
+                                    TST03_NUM_STAMPS_ROWS,
+                                    TST03_BORDER,
+                                    PM_SUBTRACTION_KERNEL_POIS);
+
+
+    srand(1995);
+    if (1)
+        testStatus|= testSubCalcEqu(TST03_NUM_COLS,
+                                    TST03_NUM_ROWS,
+                                    TST03_NUM_STAMPS_COLS,
+                                    TST03_NUM_STAMPS_ROWS,
+                                    TST03_BORDER,
+                                    PM_SUBTRACTION_KERNEL_ISIS);
+
+
+
+    return(!testStatus);
+}
Index: /trunk/psModules/test/imsubtract/tst_pmSubtractBias.c
===================================================================
--- /trunk/psModules/test/imsubtract/tst_pmSubtractBias.c	(revision 5169)
+++ /trunk/psModules/test/imsubtract/tst_pmSubtractBias.c	(revision 5169)
@@ -0,0 +1,1095 @@
+/** @file tst_pmSubtractBias.c
+ *
+ *  @brief Contains the tests for pmSubtractBias.c:
+ *
+ * test00: This code will subtract full bias frames from the input image.
+ * test01: Multiple overscan regions, calculate a scalar statistic for
+ *  each, then subtract from the input image.
+ * test02: Calculate a column overscan vector and subtract it from each
+ *  column in the input image.
+ * test03: Calculate a row overscan vector and subtract it from each
+ *  row in the input image.
+ * test04: 
+ *
+ *  @author GLG, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmSubtractBias.h"
+static int test00(void);
+static int test01(void);
+static int test02(void);
+static int test03(void);
+static int test04(void);
+static int testX(void);
+testDescription tests[] = {
+                              {test00, 000, "pmSubtractBias", 0, true},
+                              {test01, 000, "pmSubtractBias", 0, true},
+                              {test02, 000, "pmSubtractBias", 0, true},
+                              {test03, 000, "pmSubtractBias", 0, false},
+                              {test04, 000, "pmSubtractBias", 0, true},
+                              {testX,  000, "pmSubtractBias", 0, true},
+                              {NULL}
+                          };
+
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+#define NUM_ROWS 8
+#define NUM_COLS 8
+/******************************************************************************
+doSubtractBiasFullFrame(): a sample pmReadout as well as a bias image are
+created and the bias image is subtracted from the pmReadout.
+ *****************************************************************************/
+int doSubtractBiasFullFrame(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1);
+    //    pmReadout *myBias = pmReadoutAlloc(numCols, numRows, tmpImage2);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *myBias = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    myBias->image = tmpImage2;
+
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "doSubtractBiasFullFrame");
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            myBias->image->data.F32[i][j] = 1.0;
+        }
+    }
+
+    myReadout = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, NULL,
+                               0, PM_FIT_NONE, myBias);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 1.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(myBias);
+    printFooter(stdout, "pmSubtractBias", "doSubtractBiasFullFrame", true);
+    return(testStatus);
+}
+
+
+int test00( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doSubtractBiasFullFrame(1, 1);
+    testStatus |= doSubtractBiasFullFrame(NUM_COLS, 1);
+    testStatus |= doSubtractBiasFullFrame(1, NUM_ROWS);
+    testStatus |= doSubtractBiasFullFrame(NUM_COLS, NUM_ROWS);
+    return(testStatus);
+}
+
+/******************************************************************************
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
+images of the same size are created.  The overscan images are then subtracted
+from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscans(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "doSubtractFullOverscans");
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_ALL, stat,
+                               0, PM_FIT_NONE, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+
+    printFooter(stdout, "pmSubtractBias", "doSubtractFullOverscans", true);
+    return(testStatus);
+}
+
+int test01( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doSubtractFullOverscans(1, 1);
+    testStatus |= doSubtractFullOverscans(1, NUM_ROWS);
+    testStatus |= doSubtractFullOverscans(NUM_COLS, 1);
+    testStatus |= doSubtractFullOverscans(NUM_COLS, NUM_ROWS);
+
+    return(testStatus);
+}
+
+/******************************************************************************
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
+images of the same size are created.  The overscan images are collected
+pixel-by-pixel then subtracted column-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanColumns(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Column Overscans");
+
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_COLUMNS, stat,
+                               0, PM_FIT_NONE, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+
+    printFooter(stdout, "pmSubtractBias", "Column Overscans", true);
+    return(testStatus);
+}
+/******************************************************************************
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
+images of the same size are created.  The overscan images are collected
+pixel-by-pixel then subtracted column-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanColumnsPoly(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psPolynomial1D *myPoly = psPolynomial1DAlloc(1, PS_POLYNOMIAL_ORD);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Column Overscans");
+
+    myReadout = pmSubtractBias(myReadout, myPoly, list, PM_OVERSCAN_COLUMNS, stat,
+                               0, PM_FIT_POLYNOMIAL, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+    psFree(myPoly);
+
+    printFooter(stdout, "pmSubtractBias", "Column Overscans", true);
+    return(testStatus);
+}
+/******************************************************************************
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
+images of smaller size are created.  The overscan images are collected
+pixel-by-pixel then subtracted column-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanColumnsSmall(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    psImage *tmpImage2 = psImageAlloc(numCols/2, numRows/2, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols/2, numRows/2, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols/2, numRows/2, PS_TYPE_F32);
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+    for (i=0;i<numRows/2;i++) {
+        for (j=0;j<numCols/2;j++) {
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Column Overscans");
+
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_COLUMNS, stat,
+                               0, PM_FIT_POLYNOMIAL, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+
+    printFooter(stdout, "pmSubtractBias", "Column Overscans", true);
+    return(testStatus);
+}
+
+int test02( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doSubtractFullOverscanColumns(1, 1);
+    testStatus |= doSubtractFullOverscanColumns(1, NUM_ROWS);
+    testStatus |= doSubtractFullOverscanColumns(NUM_COLS, 1);
+    testStatus |= doSubtractFullOverscanColumns(NUM_COLS, NUM_ROWS);
+    /* These tests do not make sense until the SDRS is clarified.
+        testStatus |= doSubtractFullOverscanColumnsSmall(1, 1);
+        testStatus |= doSubtractFullOverscanColumnsSmall(1, NUM_ROWS);
+        testStatus |= doSubtractFullOverscanColumnsSmall(NUM_COLS, 1);
+        testStatus |= doSubtractFullOverscanColumnsSmall(NUM_COLS, NUM_ROWS);
+    */
+
+    return(testStatus);
+}
+
+/******************************************************************************
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
+images of the same size are created.  The overscan images are collected
+pixel-by-pixel then subtracted row-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanRows(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Row Overscans");
+
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_ROWS, stat,
+                               0, PM_FIT_NONE, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+
+    printFooter(stdout, "pmSubtractBias", "Row Overscans", true);
+    return(testStatus);
+}
+
+/******************************************************************************
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
+images of smaller size are created.  The overscan images are collected
+pixel-by-pixel then subtracted row-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanRowsSmall(int numCols, int numRows)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+    psS32 OSnumRows = numRows-1;
+    if (OSnumRows == 0) {
+        OSnumRows = 1;
+    }
+    psS32 OSnumCols = numCols-1;
+    if (OSnumCols == 0) {
+        OSnumCols = 1;
+    }
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    psList *list;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+    for (i=0;i<OSnumRows;i++) {
+        for (j=0;j<OSnumCols;j++) {
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Row Overscans");
+
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_ROWS, stat,
+                               0, PM_FIT_SPLINE, NULL);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+
+    printFooter(stdout, "pmSubtractBias", "Row Overscans", true);
+    return(testStatus);
+}
+
+
+// XXX: HEY
+int test03( void )
+{
+    int testStatus = 0;
+
+    //    testStatus |= doSubtractFullOverscanRows(1, 1);
+    //    testStatus |= doSubtractFullOverscanRows(1, NUM_ROWS);
+    //    testStatus |= doSubtractFullOverscanRows(NUM_COLS, 1);
+    //    testStatus |= doSubtractFullOverscanRows(NUM_COLS, NUM_ROWS);
+    //    testStatus |= doSubtractFullOverscanRowsSmall(1, 1);
+    //    testStatus |= doSubtractFullOverscanRowsSmall(1, NUM_ROWS);
+    //    testStatus |= doSubtractFullOverscanRowsSmall(NUM_COLS, 1);
+    testStatus |= doSubtractFullOverscanRowsSmall(NUM_COLS, NUM_ROWS);
+
+    return(testStatus);
+}
+
+
+
+int doSubtractOverscansTestInputCases(int numCols, int numRows)
+{
+    int i;
+    int j;
+    int testStatus = 0;
+    psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psImage *tmpImage2Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32);
+    psImage *tmpImage3Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32);
+    psImage *tmpImage4Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    pmReadout *rc = NULL;
+    psList *list;
+    psList *listShort;
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psImage *tmpImage5 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    pmReadout *myBias = pmReadoutAlloc(NULL);
+    myBias->image = tmpImage5;
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Testing input parameter error conditions");
+
+    psImage *tmpImage5ShortRows = psImageAlloc(numCols, numRows-1, PS_TYPE_F32);
+    pmReadout *myBiasShortRows = pmReadoutAlloc(NULL);
+    myBiasShortRows->image = tmpImage5ShortRows;
+    psImage *tmpImage5ShortCols = psImageAlloc(numCols-1, numRows, PS_TYPE_F32);
+    pmReadout *myBiasShortCols = pmReadoutAlloc(NULL);
+    myBiasShortCols->image = tmpImage5ShortCols;
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+            myBias->image->data.F32[i][j] = 1.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    for (i=0;i<numRows-1;i++) {
+        for (j=0;j<numCols-1;j++) {
+            tmpImage2Short->data.F32[i][j] = 3.0;
+            tmpImage3Short->data.F32[i][j] = 4.0;
+            tmpImage4Short->data.F32[i][j] = 5.0;
+        }
+    }
+    listShort = psListAlloc(tmpImage2Short);
+    psListAdd(listShort, PS_LIST_HEAD, tmpImage3Short);
+    psListAdd(listShort, PS_LIST_HEAD, tmpImage4Short);
+    for (i=0;i<numRows-1;i++) {
+        for (j=0;j<numCols;j++) {
+            myBiasShortRows->image->data.F32[i][j] = 1.0;
+        }
+    }
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols-1;j++) {
+            myBiasShortCols->image->data.F32[i][j] = 1.0;
+        }
+    }
+
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ALL.  Should generate error.\n");
+    rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ALL, stat, 0, PM_FIT_NONE, NULL);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+    }
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ROWS.  Should generate error.\n");
+    rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ROWS, stat, 0, PM_FIT_NONE, NULL);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_COLUMNS.  Should generate error.\n");
+    rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_COLUMNS, stat, 0, PM_FIT_NONE, NULL);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with non-NULL overscan list and PM_OVERSCAN_NONE.  Should generate warning.\n");
+    rc = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_NONE, stat, 0, PM_FIT_NONE, myBias);
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            psF32 expect = ((float) (i + j)) - 1.0;
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+
+            // Restore myReadout for next test.
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+    /* XXX: This does not seem to be a requirement.
+        printf("------------------------------------------------------------------\n");
+        printf("Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_NONE.  Should generate warning.\n");
+        rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, stat,
+                            0, PM_FIT_NONE, myBias);
+     
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                psF32 expect = ((float) (i + j)) - 1.0;
+                psF32 actual = rc->image->data.F32[i][j];
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = 1;
+                }
+     
+                // Restore myReadout for next test.
+                myReadout->image->data.F32[i][j] = (float) (i + j);
+            }
+        }
+    */
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with PM_OVERSCAN_NONE and PM_FIT_POLYNOMIAL.  Should generate Warning.\n");
+    rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, stat, 0, PM_FIT_POLYNOMIAL, myBias);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            psF32 expect = ((float) (i + j)) - 1.0;
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+
+            // Restore myReadout for next test.
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with PM_OVERSCAN_ALL and PM_FIT_SPLINE.  Should generate Warning.\n");
+    rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, stat, 0, PM_FIT_SPLINE, myBias);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            psF32 expect = ((float) (i + j)) - 1.0;
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+
+            // Restore myReadout for next test.
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with multiple stats->options.  Should generate Warning.\n");
+    stat->options|= PS_STAT_SAMPLE_MEDIAN;
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_ALL, stat,
+                               0, PM_FIT_NONE, NULL);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            psF32 expect = ((float) (i + j)) - 12.0;
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+    stat->options = PS_STAT_SAMPLE_MEAN;
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_ROWS).  Should generate Warning.\n");
+    rc = pmSubtractBias(myReadout, NULL, listShort, PM_OVERSCAN_ROWS, stat,
+                        0, PM_FIT_NONE, NULL);
+    /*
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                psF32 expect = ((float) (i + j)) - 12.0;
+                psF32 actual = rc->image->data.F32[i][j];
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = 1;
+                }
+            }
+        }
+    */
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_COLUMNS).  Should generate Warning.\n");
+    rc = pmSubtractBias(myReadout, NULL, listShort, PM_OVERSCAN_COLUMNS, stat,
+                        0, PM_FIT_NONE, NULL);
+    /*
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                psF32 expect = ((float) (i + j)) - 12.0;
+                psF32 actual = rc->image->data.F32[i][j];
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = 1;
+                }
+            }
+        }
+    */
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() undersize bias image (short rows).  Should generate Error.\n");
+    myReadout = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, NULL,
+                               0, PM_FIT_NONE, myBiasShortRows);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() undersize bias image (short columns).  Should generate Error.\n");
+    myReadout = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, NULL,
+                               0, PM_FIT_NONE, myBiasShortCols);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with bogus PM_FIT.  Should generate Error.\n");
+    myReadout = pmSubtractBias(myReadout, NULL, list, PM_OVERSCAN_ROWS, stat,
+                               0, 54321, NULL);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    printf("------------------------------------------------------------------\n");
+    printf("Calling pmSubtractBias() with bogus overScanAxis.  Should generate Error.\n");
+    myReadout = pmSubtractBias(myReadout, NULL, list, 54321, stat,
+                               0, PM_FIT_NONE, NULL);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    /*
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                psF32 expect = ((float) (i + j)) - 12.0;
+                psF32 actual = rc->image->data.F32[i][j];
+                if (FLT_EPSILON < fabs(expect - actual)) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                    testStatus = 1;
+                }
+            }
+        }
+    */
+
+    printf("------------------------------------------------------------------\n");
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(tmpImage2Short);
+    psFree(tmpImage3Short);
+    psFree(tmpImage4Short);
+    psFree(myBias);
+    psFree(myBiasShortRows);
+    psFree(myBiasShortCols);
+    psFree(stat);
+    psFree(list);
+    psFree(listShort);
+
+    printFooter(stdout, "pmSubtractBias", "Testing input parameter error conditions", true);
+    return(testStatus);
+}
+
+int test04( void )
+{
+    int testStatus = 0;
+
+    testStatus |= doSubtractOverscansTestInputCases(NUM_COLS, NUM_ROWS);
+    return(testStatus);
+}
+
+/******************************************************************************
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
+images of smaller size are created.  The overscan images are collected
+pixel-by-pixel then subtracted column-wise from the pmReadout.
+ *****************************************************************************/
+int doSubtractFullOverscanColumnsGeneric(int imageNumCols,
+        int imageNumRows,
+        int overscanNumCols,
+        int overscanNumRows,
+        pmOverscanAxis overscanaxis,
+        pmFit fit,
+        psS32 nBin)
+{
+    int i;
+    int j;
+    float actual;
+    float expect;
+    int testStatus = 0;
+
+    psImage *tmpImage1 = psImageAlloc(imageNumCols, imageNumRows, PS_TYPE_F32);
+    //    pmReadout *myReadout = pmReadoutAlloc(imageNumCols, imageNumRows, tmpImage1);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImage1;
+    for (i=0;i<imageNumRows;i++) {
+        for (j=0;j<imageNumCols;j++) {
+            myReadout->image->data.F32[i][j] = (float) (i + j);
+        }
+    }
+
+    psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psPolynomial1D *myPoly = psPolynomial1DAlloc(1, PS_POLYNOMIAL_ORD);
+    psSpline1D *mySpline = NULL;
+
+
+    /*
+        if (overscanNumRows <= 0) {
+            overscanNumRows = 1;
+        }
+        if (overscanNumCols <= 0) {
+            overscanNumCols = 1;
+        }
+    */
+    psImage *tmpImage2 = psImageAlloc(overscanNumCols, overscanNumRows, PS_TYPE_F32);
+    psImage *tmpImage3 = psImageAlloc(overscanNumCols, overscanNumRows, PS_TYPE_F32);
+    psImage *tmpImage4 = psImageAlloc(overscanNumCols, overscanNumRows, PS_TYPE_F32);
+    psList *list;
+    for (i=0;i<overscanNumRows;i++) {
+        for (j=0;j<overscanNumCols;j++) {
+            tmpImage2->data.F32[i][j] = 3.0;
+            tmpImage3->data.F32[i][j] = 4.0;
+            tmpImage4->data.F32[i][j] = 5.0;
+        }
+    }
+    list = psListAlloc(tmpImage2);
+    psListAdd(list, PS_LIST_HEAD, tmpImage3);
+    psListAdd(list, PS_LIST_HEAD, tmpImage4);
+
+    printPositiveTestHeader(stdout, "pmSubtractBias", "Column Overscans");
+
+    if (fit == PM_FIT_NONE) {
+        myReadout = pmSubtractBias(myReadout, NULL, list, overscanaxis, stat,
+                                   nBin, fit, NULL);
+    } else if (fit == PM_FIT_POLYNOMIAL) {
+        myReadout = pmSubtractBias(myReadout, myPoly, list, overscanaxis, stat,
+                                   nBin, fit, NULL);
+    } else if (fit == PM_FIT_SPLINE) {
+        myReadout = pmSubtractBias(myReadout, mySpline, list, overscanaxis, stat,
+                                   nBin, fit, NULL);
+    }
+
+    for (i=0;i<imageNumRows;i++) {
+        for (j=0;j<imageNumCols;j++) {
+            expect = ((float) (i + j)) - 12.0;
+            actual = myReadout->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = 1;
+            }
+        }
+    }
+
+
+    psFree(myReadout);
+    psFree(tmpImage2);
+    psFree(tmpImage3);
+    psFree(tmpImage4);
+    psFree(stat);
+    psFree(list);
+    psFree(myPoly);
+    psFree(mySpline);
+
+    printFooter(stdout, "pmSubtractBias", "Column Overscans", true);
+    return(testStatus);
+}
+
+int testX( void )
+{
+    int testStatus = 0;
+
+    // imageNumCols, imageNumRows, overscanNumCols, overscanNumRows,
+    // overscanaxis, fit, nBin
+
+    //
+    // Overscan images are same size, no fit, bin factor is 1.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_NONE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_NONE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_NONE, 1);
+
+    //
+    // Overscan images are same size, no fit, bin factor is 2.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_NONE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_NONE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_NONE, 2);
+    //
+    // Overscan images are too small, spline fit, bin factor is 1.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_SPLINE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_SPLINE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_SPLINE, 1);
+
+    //
+    // Overscan images are too small, spline fit, bin factor is 2.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_SPLINE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_SPLINE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS-1, NUM_ROWS-1,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_SPLINE, 2);
+
+    //
+    // Overscan images are same size, spline fit, bin factor is 1.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_SPLINE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_SPLINE, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_SPLINE, 1);
+    //
+    // Overscan images are same size, spline fit, bin factor is 2.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_SPLINE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_SPLINE, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_SPLINE, 2);
+
+    //
+    // Overscan images are same size, polynomial fit, bin factor is 1.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_POLYNOMIAL, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_POLYNOMIAL, 1);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_POLYNOMIAL, 1);
+    //
+    // Overscan images are same size, polynomial fit, bin factor is 2.
+    //
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ALL,
+                  PM_FIT_POLYNOMIAL, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_COLUMNS,
+                  PM_FIT_POLYNOMIAL, 2);
+
+    testStatus |= doSubtractFullOverscanColumnsGeneric(NUM_COLS, NUM_ROWS,
+                  NUM_COLS, NUM_ROWS,
+                  PM_OVERSCAN_ROWS,
+                  PM_FIT_POLYNOMIAL, 2);
+
+    return(testStatus);
+}
+
Index: /trunk/psModules/test/imsubtract/tst_pmSubtractSky.c
===================================================================
--- /trunk/psModules/test/imsubtract/tst_pmSubtractSky.c	(revision 5169)
+++ /trunk/psModules/test/imsubtract/tst_pmSubtractSky.c	(revision 5169)
@@ -0,0 +1,366 @@
+/** @file tst_pmSubtractSky.c
+ *
+ *  @brief Contains the tests for pmSubtractSky.c:
+ *
+ * test00: This code will ...
+ *
+ *  @author GLG, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+
+
+#include "psTest.h"
+#include "pslib.h"
+#include "pmSubtractSky.h"
+#define NUM_ROWS 512
+#define NUM_COLS 512
+#define POLY_X_ORDER 3
+#define POLY_Y_ORDER 3
+#define ERROR_TOLERANCE 1.0
+#define OBJECT_INTENSITY 2000.0
+static int test00(void);
+static int test01(void);
+testDescription tests[] = {
+                              {test00, 000, "pmSubtractSky", 0, false},
+                              {test01, 000, "pmSubtractSky: warning, error messages", 0, false},
+                              {NULL}
+                          };
+
+float func(int i, int j)
+{
+    return((float) (i + j));
+}
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+    //    test00();
+}
+
+/******************************************************************************
+ *****************************************************************************/
+int doSubtractSkySimple(int numCols, int numRows, int binFactor)
+{
+    int i;
+    int j;
+    int testStatus = 0;
+    psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImageF32;
+    psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psPolynomial2D *myPoly = psPolynomial2DAlloc(POLY_X_ORDER, POLY_Y_ORDER, PS_POLYNOMIAL_ORD);
+
+    printPositiveTestHeader(stdout, "pmSubtractSky", "doSubtractSkySimple");
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = func(i, j);
+        }
+    }
+
+    myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
+                              binFactor, myStats, 10.0);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
+                testStatus = 1;
+            }
+        }
+    }
+    psFree(myReadout);
+    psFree(myStats);
+    psFree(myPoly);
+    printFooter(stdout, "pmSubtractSky", "doSubtractSkySimple", true);
+    return(testStatus);
+}
+
+/******************************************************************************
+ *****************************************************************************/
+int doSubtractSkyWithObjects(int numCols, int numRows, int binFactor)
+{
+    int i;
+    int j;
+    int testStatus = 0;
+    psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImageF32;
+    psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psPolynomial2D *myPoly = psPolynomial2DAlloc(POLY_X_ORDER, POLY_Y_ORDER, PS_POLYNOMIAL_ORD);
+    psImage *trueImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psF32 errorTolerance = ERROR_TOLERANCE * ((psF32) binFactor);
+
+    printPositiveTestHeader(stdout, "pmSubtractSky", "doSubtractSkyWithObjects");
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            myReadout->image->data.F32[i][j] = func(i, j);
+        }
+    }
+    // We insert a few bright spots in the image.
+    myReadout->image->data.F32[NUM_ROWS/4][NUM_COLS/4]+= OBJECT_INTENSITY;
+    myReadout->image->data.F32[NUM_ROWS/4][3*NUM_COLS/4]+= OBJECT_INTENSITY;
+    myReadout->image->data.F32[3*NUM_ROWS/4][NUM_COLS/4]+= OBJECT_INTENSITY;
+    myReadout->image->data.F32[3*NUM_ROWS/4][3*NUM_COLS/4]+= OBJECT_INTENSITY;
+    PS_IMAGE_SET_F32(trueImage, 0.0);
+    trueImage->data.F32[NUM_ROWS/4][NUM_COLS/4]+= OBJECT_INTENSITY;
+    trueImage->data.F32[NUM_ROWS/4][3*NUM_COLS/4]+= OBJECT_INTENSITY;
+    trueImage->data.F32[3*NUM_ROWS/4][NUM_COLS/4]+= OBJECT_INTENSITY;
+    trueImage->data.F32[3*NUM_ROWS/4][3*NUM_COLS/4]+= OBJECT_INTENSITY;
+
+    myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
+                              binFactor, myStats, 2.0);
+    for (i=0;i<numRows;i++) {
+        for (j=0;j<numCols;j++) {
+            if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
+                       myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
+                testStatus = 1;
+            }
+        }
+    }
+    psFree(myReadout);
+    psFree(myStats);
+    psFree(myPoly);
+    psFree(trueImage);
+    printFooter(stdout, "pmSubtractSky", "doSubtractSkyWithObjects", true);
+    return(testStatus);
+}
+
+
+int test00( void )
+{
+    int testStatus = 0;
+
+    psTraceSetLevel(".", 0);
+
+    // Bin Factor == 1
+    printf("doSubtractSkySimple(1, 1, 1)\n");
+    testStatus |= doSubtractSkySimple(1, 1, 1);
+    printf("doSubtractSkySimple(NUM_COLS, 1, 1)\n");
+    testStatus |= doSubtractSkySimple(NUM_COLS, 1, 1);
+
+    printf("doSubtractSkySimple(1, NUM_ROWS, 1)\n");
+    testStatus |= doSubtractSkySimple(1, NUM_ROWS, 1);
+    printf("doSubtractSkySimple(NUM_COLS, NUM_ROWS, 1)\n");
+    testStatus |= doSubtractSkySimple(NUM_COLS, NUM_ROWS, 1);
+
+    // Bin Factor == 2
+    printf("doSubtractSkySimple(1, 1, 2)\n");
+    testStatus |= doSubtractSkySimple(1, 1, 2);
+    printf("doSubtractSkySimple(NUM_COLS, 1, 2)\n");
+    testStatus |= doSubtractSkySimple(NUM_COLS, 1, 2);
+    printf("doSubtractSkySimple(1, NUM_ROWS, 2)\n");
+    testStatus |= doSubtractSkySimple(1, NUM_ROWS, 2);
+    printf("doSubtractSkySimple(NUM_COLS, NUM_ROWS, 2)\n");
+    testStatus |= doSubtractSkySimple(NUM_COLS, NUM_ROWS, 2);
+
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 1)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 1);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 2)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 2);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 4)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 8);
+
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 8)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 8);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 16)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 16);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 32)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 32);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 64)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 64);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 128)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 128);
+    printf("doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 256)\n");
+    testStatus |= doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 256);
+
+    return(testStatus);
+}
+
+#define NUM_ROWS_SMALL 16
+#define NUM_COLS_SMALL 16
+int test01( void )
+{
+    int testStatus = 0;
+    psS32 i;
+    psS32 j;
+    psImage *tmpImageF32 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F32);
+    psImage *tmpImageF64 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F64);
+    //    pmReadout *myReadout = pmReadoutAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImageF32;
+    pmReadout *rc = NULL;
+    psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    psPolynomial2D *myPoly = psPolynomial2DAlloc(POLY_X_ORDER, POLY_Y_ORDER, PS_POLYNOMIAL_ORD);
+
+    printPositiveTestHeader(stdout, "pmSubtractSky", "Testing bad input parameter conditions.");
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            myReadout->image->data.F32[i][j] = func(i, j);
+        }
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with NULL pmReadout.  Should error.\n\n");
+    rc = pmSubtractSky(NULL, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with NULL pmReadout->image.  Should error.\n\n");
+    myReadout->image = NULL;
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+    myReadout->image = tmpImageF32;
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image.  Should error.\n\n");
+    myReadout->image = tmpImageF64;
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+    myReadout->image = tmpImageF32;
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with NULL fitSpec.  Should return image, no ERROR, no WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, NULL, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with PM_FIT_NONE fit.  Should return image, no ERROR, no WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_NONE, 1, myStats, 2.0);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with PM_FIT_SPLINE fit.  Should return image, no ERROR, no WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_SPLINE, 1, myStats, 2.0);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with NULL myStats.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, NULL, 2.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("----------------------------------------------------------------\n");
+    psU64 oldOptions = myStats->options;
+    myStats->options = 0;
+    printf("Calling pmSubtractSky() with no myStats->options specified.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+    myStats->options = oldOptions;
+
+    printf("----------------------------------------------------------------\n");
+    oldOptions = myStats->options;
+    myStats->options = PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_MEDIAN;
+    printf("Calling pmSubtractSky() with multiple myStats->options specified.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+    myStats->options = oldOptions;
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with 0 binFactor.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 0, myStats, 2.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with -1 binFactor.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, -1, myStats, 2.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with -1.0 clipSD.  Should fit entire image, generate WARNING.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, -1.0);
+    for (i=0;i<NUM_ROWS_SMALL;i++) {
+        for (j=0;j<NUM_COLS_SMALL;j++) {
+            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
+                       rc->image->data.F32[i][j]);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with bogus psFit.  Should generate Error.\n\n");
+    rc = pmSubtractSky(myReadout, (void *) myPoly, 54321, 1, myStats, -1.0);
+    if (rc != myReadout) {
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
+        testStatus = false;
+    }
+
+
+    //    myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
+    //                              1, myStats, 2.0);
+
+
+    printf("----------------------------------------------------------------\n");
+    psFree(myReadout);
+    psFree(myStats);
+    psFree(myPoly);
+    psFree(tmpImageF64);
+    printFooter(stdout, "pmSubtractSky", "Testing bad input parameter conditions.", true);
+    return(testStatus);
+}
Index: /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stderr
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stderr	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stderr	(revision 5169)
@@ -0,0 +1,96 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmImageSubtract.c                                      *
+*            TestPoint: Test Point Driver{pmSubtractionKernelsAllocPOIS()}         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractionKernelsAllocPOIS()} | tst_pmImageSubtract.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmImageSubtract.c                                      *
+*            TestPoint: Test Point Driver{pmSubtractionKernelsAllocISIS()}         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractionKernelsAllocISIS()} | tst_pmImageSubtract.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmImageSubtract.c                                      *
+*            TestPoint: Test Point Driver{pmSubtractionFindStamps()}               *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: xNum is 0 or less.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: yNum is 0 or less.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: border is 0 or less.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: xNum is 0 or less.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: yNum is 0 or less.
+<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
+    Error: border is 0 or less.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractionFindStamps()} | tst_pmImageSubtract.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmImageSubtract.c                                      *
+*            TestPoint: Test Point Driver{pmSubtractionCalculateEquation()}        *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: stamps is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: psImage reference or its data is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: psImage input or its data is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: kernels is NULL.
+<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
+    Unallowable operation: stamps is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Unallowable operation: psVector solution or its data is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Unallowable operation: kernels is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: stamps is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: psImage reference or its data is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: psImage input or its data is NULL.
+<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
+    Unallowable operation: kernels is NULL.
+<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
+    Unallowable operation: stamps is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Unallowable operation: psVector solution or its data is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Unallowable operation: kernels is NULL.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
+    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractionCalculateEquation()} | tst_pmImageSubtract.c)
+
Index: /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stdout
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stdout	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmImageSubtract.stdout	(revision 5169)
@@ -0,0 +1,73 @@
+Testing pmSubtractionKernelsAllocPOIS(1, 1)
+Testing pmSubtractionKernelsAllocPOIS(2, 3)
+Testing pmSubtractionKernelsAllocPOIS(3, 4)
+Testing pmSubtractionFindStamps(100, 100, 2, 2, 2)
+Calling with a NULL psImage.  Should generate error, return NULL.
+Calling with a non-positive xNum.  Should generate error, return NULL.
+Calling with a non-positive yNum.  Should generate error, return NULL.
+Calling with a non-positive border.  Should generate error, return NULL.
+Calling with acceptable input parameters, non-NULL mask.
+Calling with acceptable input parameters, NULL mask.
+Testing pmSubtractionFindStamps(100, 100, 10, 10, 2)
+Calling with a NULL psImage.  Should generate error, return NULL.
+Calling with a non-positive xNum.  Should generate error, return NULL.
+Calling with a non-positive yNum.  Should generate error, return NULL.
+Calling with a non-positive border.  Should generate error, return NULL.
+Calling with acceptable input parameters, non-NULL mask.
+Calling with acceptable input parameters, NULL mask.
+Testing pmSubtractionCalculateEquation(): 
+    image size is (25, 25)
+    num stamps is (2, 2).  Border is 2
+   kernel type is PM_SUBTRACTION_KERNEL_POIS.
+Generating stamps...
+Generating kernel basis functions...
+Calling with a NULL psArray stamps.  Should generate error, return FALSE.
+Calling with a NULL reference images.  Should generate error, return FALSE.
+Calling with a NULL input images.  Should generate error, return FALSE.
+Calling with a NULL kernel basis functions.  Should generate error, return FALSE.
+Calling with acceptable input parameters.  Should return TRUE.
+Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
+Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
+The solution vector is:
+(-3866492.76) (-520094.85) (-1277345.36) (-481569.41) (0.21) (-1182727.56) (0.01) (0.01) (-0.00) (-0.02) (-0.00) (0.00) (-0.01) (0.01) (-0.00) (-0.01) (0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.01) (0.01) (-0.03) (0.01) (0.00) (-0.01) (0.00) (0.00) (0.01) (-0.01) (-0.02) (0.00) (0.01) (0.01) (-0.01) (0.01) (-0.00) (-0.01) (0.00) (0.01) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (0.04) (-0.02) (-0.02) (0.01) (0.02) (0.01) (-0.03) (0.03) (0.02) (-0.02) (-0.01) (-0.01) (-0.01) (0.01) (0.00) (-0.01) (0.00) (0.00) (-0.02) (0.01) (0.01) (-0.01) (0.00) (-0.00) (-0.01) (-0.02) (0.01) (0.02) (0.02) (-0.01) (0.04) (0.00) (-0.01) (-0.01) (-0.02) (-0.00) (0.00) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.00) (-0.01) (-0.02) (0.02) (0.02) (0.02) (0.01) (-0.01) (-0.02) (0.01) (0.01) (0.02) (0.03) (-0.00) (-0.05) (-0.00) (0.01) (0.05) (-0.04) (0.03) (0.03) (-0.03) (-0.04) (-0.02) (-0.02) (-0.00) (0.00) (0.01) (0.00) (0.00) (-0.02) (0.01) (0.01) (-0.00) (-0.00) (-0.01) (-0.03) (0.02) (0.01) (-0.02) (-0.01) (-0.00) (0.01) (-0.01) (-0.02) (0.01) (0.00) (0.02) (-0.03) (0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.02) (-0.02) (0.02) (0.01) (0.02) (0.49) 
+Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
+Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
+-0.001170 -0.025330 0.003882 -0.024851 -0.014656 
+-0.019844 -0.032570 0.014897 0.002807 0.000729 
+0.002328 0.031599 -5181287.500000 -0.004433 -0.013596 
+-0.008172 -0.016571 0.033990 -0.012052 -0.002317 
+0.010558 -0.020875 0.011541 -0.006648 0.006954 
+Testing pmSubtractionCalculateEquation(): 
+    image size is (25, 25)
+    num stamps is (2, 2).  Border is 2
+   kernel type is PM_SUBTRACTION_KERNEL_ISIS.
+Generating stamps...
+Generating kernel basis functions...
+Calling with a NULL psArray stamps.  Should generate error, return FALSE.
+Calling with a NULL reference images.  Should generate error, return FALSE.
+Calling with a NULL input images.  Should generate error, return FALSE.
+Calling with a NULL kernel basis functions.  Should generate error, return FALSE.
+Calling with acceptable input parameters.  Should return TRUE.
+Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
+Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
+The solution vector is:
+(0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.55) 
+Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
+Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
+Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
+0.031614 0.045997 0.052122 0.045997 0.031614 
+0.045997 0.066926 0.075837 0.066926 0.045997 
+0.052122 0.075837 0.085934 0.075837 0.052122 
+0.045997 0.066926 0.075837 0.066926 0.045997 
+0.031614 0.045997 0.052122 0.045997 0.031614 
Index: /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stderr
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stderr	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stderr	(revision 5169)
@@ -0,0 +1,132 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals NONE and overscans does not equal NULL.  Proceeding to full fram subtraction.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals NONE, and fit does not equal NONE.  Proceeding to full fram subtraction.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals NONE, and fit does not equal NONE.  Proceeding to full fram subtraction.
+<HOST>|W|GenNewStatOptions
+    WARNING: pmSubtractBias.c: GenNewStatOptions(): Too many statistics options have been specified
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    Don't know how to scale the overscan vector.  Set fit to PM_FIT_SPLINE or PM_FIT_POLYNOMIAL.  Returning in image.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    Don't know how to scale the overscan vector.  Set fit to PM_FIT_SPLINE or PM_FIT_POLYNOMIAL.  Returning in image.
+<HOST>|E|SubtractFrame (FILE:LINENO)
+    bias image does not have enough rows.  Returning in image
+<HOST>|E|SubtractFrame (FILE:LINENO)
+    bias image does not have enough columns.  Returning in image
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    fit is unallowable (54321).  Returning in image.
+<HOST>|E|pmSubtractBias (FILE:LINENO)
+    overScanAxis is unallowable (54321).  Returning in image.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: Test Point Driver{pmSubtractBias}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+<HOST>|W|pmSubtractBias
+    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
+
Index: /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stdout
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stdout	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmSubtractBias.stdout	(revision 5169)
@@ -0,0 +1,432 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Row Overscans}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Testing input parameter error conditions}   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+------------------------------------------------------------------
+Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ALL.  Should generate error.
+------------------------------------------------------------------
+Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ROWS.  Should generate error.
+------------------------------------------------------------------
+Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_COLUMNS.  Should generate error.
+------------------------------------------------------------------
+Calling pmSubtractBias() with non-NULL overscan list and PM_OVERSCAN_NONE.  Should generate warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() with PM_OVERSCAN_NONE and PM_FIT_POLYNOMIAL.  Should generate Warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() with PM_OVERSCAN_ALL and PM_FIT_SPLINE.  Should generate Warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() with multiple stats->options.  Should generate Warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_ROWS).  Should generate Warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_COLUMNS).  Should generate Warning.
+------------------------------------------------------------------
+Calling pmSubtractBias() undersize bias image (short rows).  Should generate Error.
+------------------------------------------------------------------
+Calling pmSubtractBias() undersize bias image (short columns).  Should generate Error.
+------------------------------------------------------------------
+Calling pmSubtractBias() with bogus PM_FIT.  Should generate Error.
+------------------------------------------------------------------
+Calling pmSubtractBias() with bogus overScanAxis.  Should generate Error.
+------------------------------------------------------------------
+
+---> TESTPOINT PASSED (pmSubtractBias{Testing input parameter error conditions} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractBias.c                                       *
+*            TestPoint: pmSubtractBias{Column Overscans}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
+
Index: /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stderr
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stderr	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stderr	(revision 5169)
@@ -0,0 +1,62 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: Test Point Driver{pmSubtractSky}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|W|p_psVectorSampleStdev
+    WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
+<HOST>|W|p_psVectorSampleStdev
+    WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
+<HOST>|W|ImageFitPolynomial
+    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractSky} | tst_pmSubtractSky.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: Test Point Driver{pmSubtractSky: warning, error messages}  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSubtractSky (FILE:LINENO)
+    Unallowable operation: psReadout in or its data is NULL.
+<HOST>|E|pmSubtractSky (FILE:LINENO)
+    Unallowable operation: psReadout in or its data is NULL.
+<HOST>|E|pmSubtractSky (FILE:LINENO)
+    Unallowable operation: psImage in has incorrect type.
+<HOST>|W|pmSubtractSky
+    WARNING: pmSubtractSky(): input parameter stats is NULL
+<HOST>|W|pmSubtractSky
+    WARNING: pmSubtractSky(): no stats->options was requested
+<HOST>|W|pmSubtractSky
+    WARNING: Multiple statistical options have been requested.
+<HOST>|W|pmSubtractSky
+    WARNING: pmSubtractSky(): binFactor is 0
+<HOST>|W|pmSubtractSky
+    WARNING: pmSubtractSky(): binFactor is -1
+<HOST>|W|pmSubtractSky
+    WARNING: pmSubtractSky(): clipSD is -1.000000
+<HOST>|E|pmSubtractSky (FILE:LINENO)
+    psFit is unallowable (54321).  Returning in image.
+
+---> TESTPOINT PASSED (Test Point Driver{pmSubtractSky: warning, error messages} | tst_pmSubtractSky.c)
+
Index: /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stdout
===================================================================
--- /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stdout	(revision 5169)
+++ /trunk/psModules/test/imsubtract/verified/tst_pmSubtractSky.stdout	(revision 5169)
@@ -0,0 +1,219 @@
+doSubtractSkySimple(1, 1, 1)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(NUM_COLS, 1, 1)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(1, NUM_ROWS, 1)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(NUM_COLS, NUM_ROWS, 1)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(1, 1, 2)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(NUM_COLS, 1, 2)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(1, NUM_ROWS, 2)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkySimple(NUM_COLS, NUM_ROWS, 2)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 1)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 2)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 4)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 8)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 16)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 32)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 64)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 128)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 256)
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmSubtractSky.c                                        *
+*            TestPoint: pmSubtractSky{Testing bad input parameter conditions.}     *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with NULL pmReadout.  Should error.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with NULL pmReadout->image.  Should error.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image.  Should error.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with NULL fitSpec.  Should return image, no ERROR, no WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with PM_FIT_NONE fit.  Should return image, no ERROR, no WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with PM_FIT_SPLINE fit.  Should return image, no ERROR, no WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with NULL myStats.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with no myStats->options specified.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with multiple myStats->options specified.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with 0 binFactor.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with -1 binFactor.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with -1.0 clipSD.  Should fit entire image, generate WARNING.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with bogus psFit.  Should generate Error.
+
+----------------------------------------------------------------
+
+---> TESTPOINT PASSED (pmSubtractSky{Testing bad input parameter conditions.} | tst_pmSubtractSky.c)
+
Index: /trunk/psModules/test/objects/Makefile.am
===================================================================
--- /trunk/psModules/test/objects/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/objects/Makefile.am	(revision 5169)
@@ -0,0 +1,21 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+
+TESTS = \
+    tst_pmObjects01
+
+tst_pmObjects01_SOURCES = tst_pmObjects01.c
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: /trunk/psModules/test/objects/tst_pmObjects01.c
===================================================================
--- /trunk/psModules/test/objects/tst_pmObjects01.c	(revision 5169)
+++ /trunk/psModules/test/objects/tst_pmObjects01.c	(revision 5169)
@@ -0,0 +1,1932 @@
+/** @file tst_pmFindObjects.c
+ *
+ *  @brief Contains the tests for pmSubtractSky.c:
+ *
+ * test00: This code will ...
+ *
+ *  @author GLG, MHPCC
+ *
+ * XXX: Must test
+ *       pmSourceRoughClass
+ *
+ * XXX: Must test output results for many other functions.
+ *
+ * XXX: There are many cases where row/col can be switched in the code.
+ * We must test that here by using non-square images.  All tests
+ * in this file should be run with non-square images.
+ *
+ * XXX: Memory leaks are not being caught.  If I allocated a psVector in these functions
+ * abd never deallocate, no error is generated.
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-28 20:42:52 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+#include "psTest.h"
+#include "pslib.h"
+#include "pmObjects.h"
+#define NUM_ROWS 10
+#define NUM_COLS 10
+#define ERROR_TOLERANCE 1.0
+#define ERROR_TOL 0.001
+static int test00(void);
+static int test01(void);
+static int test02(void);
+static int test03(void);
+static int test04(void);
+static int test05(void);
+static int test06(void);
+static int test07(void);
+static int test08(void);
+static int test09(void);
+static int test15(void);
+static int test16(void);
+static int test20(void);
+testDescription tests[] = {
+                              {test00, 000, "pmObjects: structure allocators and deallocators", true, false},
+                              {test01, 001, "pmObjects: psFindVectorPeaks()", true, false},
+                              {test02, 001, "pmObjects: psFindImagePeaks()", true, false},
+                              {test03, 001, "pmObjects: pmCullPeaks()", true, false},
+                              {test04, 001, "pmObjects: pmSourceLocalSky()", true, false},
+                              {test06, 001, "pmObjects: pmSourceSetPixelsCircle()", true, false},
+                              {test05, 001, "pmObjects: pmSourceMoments()", true, false},
+                              {test07, 001, "pmObjects: pmMin()", true, false},
+                              {test08, 001, "pmObjects: pmSourceModelGuess()", true, false},
+                              {test09, 001, "pmObjects: pmSourceContour()", true, false},
+                              {test15, 001, "pmObjects: pmSourceAddModel()", true, false},
+                              {test16, 001, "pmObjects: pmSourceSubModel()", true, false},
+                              {test20, 001, "pmObjects: pmSourceSubModel()", true, false},
+                              {NULL}
+                          };
+
+int main(int argc, char* argv[])
+{
+    psLogSetFormat("HLNM");
+    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
+}
+
+/******************************************************************************
+test00(): Test the various allocators and deallocators.
+ *****************************************************************************/
+int test00( void )
+{
+    bool testStatus = true;
+    psTraceSetLevel(".", 0);
+
+    printf("Testing pmPeakAlloc()...\n");
+    pmPeak *tmpPeak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE);
+    if (tmpPeak == NULL) {
+        printf("TEST ERROR: pmPeakAlloc() returned a NULL pmPeak\n");
+        testStatus = false;
+    } else {
+        if (tmpPeak->x != 1) {
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->x\n");
+            testStatus = false;
+        }
+        if (tmpPeak->y != 2) {
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->y\n");
+            testStatus = false;
+        }
+        if (tmpPeak->counts != 3.0) {
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->counts\n");
+            testStatus = false;
+        }
+        if (tmpPeak->class != PM_PEAK_LONE) {
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->class\n");
+            testStatus = false;
+        }
+    }
+    psFree(tmpPeak);
+
+    printf("Testing pmMomentsAlloc()...\n");
+    pmMoments *tmpMoments = pmMomentsAlloc();
+    if (tmpMoments == NULL) {
+        printf("TEST ERROR: pmMomentsAlloc() returned a NULL pmMoments\n");
+        testStatus = false;
+    } else {
+        if ((fabs(tmpMoments->x-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->y-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Sx-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Sy-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Sxy-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Sum-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Peak-0.0) > ERROR_TOL) ||
+                (fabs(tmpMoments->Sky-0.0) > ERROR_TOL) ||
+                (tmpMoments->nPixels != 0)) {
+            printf("TEST ERROR: pmMomentsAlloc() did not properly initialize the pmMoments structure.\n");
+            testStatus = false;
+        }
+    }
+    psFree(tmpMoments);
+
+    printf("Testing pmModelAlloc(PS_MODEL_GAUSS)...\n");
+    pmModel *tmpModel = pmModelAlloc(PS_MODEL_GAUSS);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 7) || (tmpModel->dparams->n != 7)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 7 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    printf("Testing pmModelAlloc(PS_MODEL_PGAUSS)...\n");
+    tmpModel = pmModelAlloc(PS_MODEL_PGAUSS);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 7) || (tmpModel->dparams->n != 7)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 7 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    printf("Testing pmModelAlloc(PS_MODEL_TWIST_GAUSS)...\n");
+    tmpModel = pmModelAlloc(PS_MODEL_TWIST_GAUSS);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 11) || (tmpModel->dparams->n != 11)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 11 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    printf("Testing pmModelAlloc(PS_MODEL_WAUSS)...\n");
+    tmpModel = pmModelAlloc(PS_MODEL_WAUSS);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 9) || (tmpModel->dparams->n != 9)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 9 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    printf("Testing pmModelAlloc(PS_MODEL_SERSIC)...\n");
+    tmpModel = pmModelAlloc(PS_MODEL_SERSIC);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 8) || (tmpModel->dparams->n != 8)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 8 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    printf("Testing pmModelAlloc(PS_MODEL_SERSIC_CORE)...\n");
+    tmpModel = pmModelAlloc(PS_MODEL_SERSIC_CORE);
+    if (tmpModel == NULL) {
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) returned a NULL pmModel\n");
+        testStatus = false;
+    } else {
+        if ((tmpModel->params->n != 12) || (tmpModel->dparams->n != 12)) {
+            printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) allocated an incorrect number of params (%ld, %ld)\n",
+                   tmpModel->params->n, tmpModel->dparams->n);
+            testStatus = false;
+        } else {
+            for (psS32 i = 0 ; i < 12 ; i++) {
+                if ((tmpModel->params->data.F32[i] != 0.0) ||
+                        (tmpModel->dparams->data.F32[i] != 0.0)) {
+                    printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) did not ininitialize the params/dparams array to 0.0.\n");
+                    testStatus = false;
+                }
+            }
+        }
+    }
+    psFree(tmpModel);
+
+    pmSource *tmpSource = pmSourceAlloc();
+    if (tmpSource == NULL) {
+        printf("TEST ERROR: pmSourceAlloc() returned a NULL pmSource\n");
+        testStatus = false;
+    }
+    psFree(tmpSource);
+
+    return(testStatus);
+}
+
+/******************************************************************************
+test01(): we first test pmFindVectorPeaks() with a variety of bad input
+parameters.  Then we test it with a simple vector both 1- and multi-elements.
+ *****************************************************************************/
+#define TST01_VECTOR_LENGTH 10
+bool test_pmFindVectorPeaks(int n)
+{
+    bool testStatus = true;
+    psVector *inData = psVectorAlloc(n, PS_TYPE_F32);
+    psVector *outData = NULL;
+
+    printf("-------------- Calling test_pmFindVectorPeaks on an %d size vector. --------------\n", n);
+    //
+    // Test first pixel peak.
+    //
+    printf("Test pmFindVectorPeaks() with a first-element peak.\n");
+    for (psS32 i = 0 ; i < n ; i++) {
+        inData->data.F32[i] = (float) (n-i);
+    }
+    inData->data.F32[0] = (float) n;
+
+    outData= pmFindVectorPeaks(inData, 0.0);
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+        if (outData->n != 1) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+        if (outData->data.U32[0] != 0) {
+            printf("TEST ERROR: Did not find peak at element 0.\n");
+            testStatus = false;
+        }
+        psFree(outData);
+    }
+
+    //
+    // Test first pixel peak, large threshold
+    //
+    printf("Test pmFindVectorPeaks() with a first-element peak, large threshold.\n");
+    for (psS32 i = 0 ; i < n ; i++) {
+        inData->data.F32[i] = (float) (n-i);
+    }
+    inData->data.F32[0] = (float) n;
+
+    outData= pmFindVectorPeaks(inData, (float) (n*n));
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+
+        if (outData->n != 0) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+        psFree(outData);
+
+        // Skip remaining tests if the input vector has length 1.
+        if (n == 1) {
+            psFree(inData);
+            return(testStatus);
+        }
+    }
+
+    //
+    // Test last pixel peak.
+    //
+    printf("Test pmFindVectorPeaks() with a last-element peak.\n");
+    for (psS32 i = 0 ; i < n ; i++) {
+        inData->data.F32[i] = (float) (i);
+    }
+    inData->data.F32[n-1] = (float) n;
+
+    outData= pmFindVectorPeaks(inData, 0.0);
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+
+        if (outData->n != 1) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+        if (outData->data.U32[0] != n-1) {
+            printf("TEST ERROR: Did not find peak at element %d.\n", n-1);
+            testStatus = false;
+        }
+        psFree(outData);
+    }
+
+    //
+    // Test last pixel peak, large threshold.
+    //
+    printf("Test pmFindVectorPeaks() with a last-element peak, large threshold.\n");
+    for (psS32 i = 0 ; i < n ; i++) {
+        inData->data.F32[i] = (float) (i);
+    }
+    inData->data.F32[n-1] = (float) n;
+
+    outData= pmFindVectorPeaks(inData, (float) (n*n));
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+
+        if (outData->n != 0) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+        psFree(outData);
+    }
+
+    //
+    // Test interior peaks.
+    // Set all even number elements to be peaks.
+    //
+    printf("Test pmFindVectorPeaks() with all even-numbered elements peak.\n");
+    for (psS32 i = 0 ; i < n ; i++) {
+        if (0 == i%2) {
+            inData->data.F32[i] = (float) (2 * i);
+        } else {
+            inData->data.F32[i] = (float) (i);
+        }
+    }
+    inData->data.F32[0] = (float) n;
+
+
+    outData= pmFindVectorPeaks(inData, 0.0);
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+
+        if (outData->n != n/2) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+
+        for (psS32 i = 0 ; i < outData->n ; i++) {
+            if (outData->data.U32[i] != (2 * i)) {
+                printf("TEST ERROR: the %d-th peak is element number %d\n", i, outData->data.U32[i]);
+                testStatus = false;
+            }
+        }
+        psFree(outData);
+    }
+
+    //
+    // Test interior peaks, with threshold = n*n.
+    // Should generate an empty output psVector.
+    //
+    printf("Test pmFindVectorPeaks() with all even-numbered elements peak, large threshold.\n");
+    outData= pmFindVectorPeaks(inData, (float) (n*n));
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks returned a NULL psVector.\n");
+        testStatus = false;
+    } else {
+
+        if (outData->n != 0) {
+            printf("TEST ERROR: outData->n is %ld\n", outData->n);
+            testStatus = false;
+        }
+        psFree(outData);
+    }
+
+    psFree(inData);
+    return(testStatus);
+}
+
+int test01( void )
+{
+    bool testStatus = true;
+    psVector *tmpVec = NULL;
+    psVector *tmpVecF64 = psVectorAlloc(TST01_VECTOR_LENGTH, PS_TYPE_F64);
+    psVector *tmpVecEmpty = psVectorAlloc(0, PS_TYPE_F32);
+
+    psTraceSetLevel(".", 0);
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindVectorPeaks with NULL psVector.  Should generate error and return NULL.\n");
+    tmpVec = pmFindVectorPeaks(NULL, 0.0);
+    if (tmpVec != NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks() returned a non-NULL psVector.\n");
+        testStatus = false;
+        psFree(tmpVec);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindVectorPeaks with empty psVector.  Should generate error and return NULL.\n");
+    tmpVec = pmFindVectorPeaks(tmpVecEmpty, 0.0);
+    if (tmpVec != NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks() returned a non-NULL psVector.\n");
+        testStatus = false;
+        psFree(tmpVec);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindVectorPeaks with PS_TYPE_F64 psVector.  Should generate error and return NULL.\n");
+    tmpVec = pmFindVectorPeaks(tmpVecF64, 0.0);
+    if (tmpVec != NULL) {
+        printf("TEST ERROR: pmFindVectorPeaks() returned a non-NULL psVector.\n");
+        testStatus = false;
+        psFree(tmpVec);
+    }
+    testStatus&= test_pmFindVectorPeaks(1);
+    testStatus&= test_pmFindVectorPeaks(TST01_VECTOR_LENGTH);
+
+    psFree(tmpVecF64);
+    psFree(tmpVecEmpty);
+    return(testStatus);
+}
+
+/******************************************************************************
+test02():
+// XXX: Must test flat peaks.
+// XXX: test 1-by-n and n-by-1 images.
+ *****************************************************************************/
+#define TST02_NUM_ROWS 5
+#define TST02_NUM_COLS 5
+bool test_pmFindImagePeaks(int numRows, int numCols)
+{
+    printf("-------------- Calling test_pmFindImagePeaks on an %d-by-%d image. --------------\n", numRows, numCols);
+    //    if ((numRows < 4) || (numCols < 4)) {
+    //        printf("WARNING: Don't call this test with a smaller than 4-by-4 image.\n");
+    //        return(true);
+    //    }
+    bool testStatus = true;
+    psImage *inData = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    psArray *outData = NULL;
+
+    //
+    // Initialize test image.
+    //
+    for (psS32 i = 0 ; i < numRows ; i++) {
+        for (psS32 j = 0 ; j < numCols ; j++) {
+            inData->data.F32[i][j] = PS_SQR(i - numRows/2) + PS_SQR(j-numCols/2);
+        }
+    }
+    //
+    // Set corner and center pixels as peaks.
+    //
+    inData->data.F32[0][0] = PS_SQR(numRows) + PS_SQR(numCols);
+    inData->data.F32[0][numCols-1] = PS_SQR(numRows) + PS_SQR(numCols);
+    inData->data.F32[numRows-1][0] = PS_SQR(numRows) + PS_SQR(numCols);
+    inData->data.F32[numRows-1][numCols-1] = PS_SQR(numRows) + PS_SQR(numCols);
+    inData->data.F32[numRows/2][numCols/2] = PS_SQR(numRows) + PS_SQR(numCols);
+
+    //
+    // Print image.
+    //
+    for (psS32 i = 0 ; i < numRows ; i++) {
+        for (psS32 j = 0 ; j < numCols ; j++) {
+            printf("(%.1f) ", inData->data.F32[i][j]);
+        }
+        printf("\n");
+    }
+
+    //
+    // Call pmFindImagePeaks() with a threshold of 0.0.
+    //
+    outData = pmFindImagePeaks(inData, 0.0);
+
+    if (outData == NULL) {
+        printf("TEST ERROR: pmFindImagePeaks returned a NULL psList.\n");
+        testStatus = false;
+    } else {
+        psS32 expectedNumPeaks;
+        if ((numRows == 1) && (numCols == 1)) {
+            expectedNumPeaks = 1;
+        } else if ((numRows == 1) || (numCols == 1)) {
+            expectedNumPeaks = 3;
+        } else {
+            expectedNumPeaks = 5;
+        }
+        if (outData->n != expectedNumPeaks) {
+            printf("TEST ERROR: pmFindImagePeaks found %ld peaks (should be %d)\n", outData->n, expectedNumPeaks);
+            testStatus = false;
+        }
+
+        // HEY: verify
+        for (psS32 i = 0 ; i < outData->n ; i++) {
+            pmPeak *tmpPeak = (pmPeak *) outData->data[i];
+            if (((tmpPeak->x == 0) && (tmpPeak->y == 0)) ||
+                    ((tmpPeak->x == 0) && (tmpPeak->y == numRows-1)) ||
+                    ((tmpPeak->x == numCols-1) && (tmpPeak->y == 0)) ||
+                    ((tmpPeak->x == numCols-1) && (tmpPeak->y == numRows-1))) {
+                if (!((tmpPeak->class & PM_PEAK_LONE) || (tmpPeak->class & PM_PEAK_EDGE))) {
+                    printf("TEST ERROR: (0) peak at (%d, %d) (%f) ->class set improperly (0x%x).",
+                           tmpPeak->y, tmpPeak->x, tmpPeak->counts, tmpPeak->class);
+                    printf(" should be (0x%x or 0x%x).\n", PM_PEAK_LONE, PM_PEAK_EDGE);
+                    testStatus = false;
+                }
+            } else if ((tmpPeak->x == numCols/2) && (tmpPeak->y == numRows/2)) {
+                if (tmpPeak->class != PM_PEAK_LONE) {
+                    printf("TEST ERROR: (1) peak at (%d, %d) (%f) ->class set improperly (0x%x).\n",
+                           tmpPeak->y, tmpPeak->x, tmpPeak->counts, tmpPeak->class);
+                    printf(" should be (0x%x).\n", PM_PEAK_LONE);
+                    testStatus = false;
+                }
+            } else {
+                printf("TEST ERROR: Peak at (%d, %d) (%f)\n", tmpPeak->y, tmpPeak->x, tmpPeak->counts);
+                testStatus = false;
+            }
+        }
+    }
+
+    psFree(inData);
+    psFree(outData);
+    return(testStatus);
+}
+
+int test02( void )
+{
+    bool testStatus = true;
+    psArray *tmpArray = NULL;
+    psImage *tmpImageF64 = psImageAlloc(TST02_NUM_ROWS, TST02_NUM_COLS, PS_TYPE_F64);
+    psImage *tmpImageEmpty = psImageAlloc(0, 0, PS_TYPE_F32);
+
+    psTraceSetLevel(".", 0);
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindImagePeaks with NULL psImage.  Should generate error and return NULL.\n");
+    tmpArray = pmFindImagePeaks(NULL, 0.0);
+    if (tmpArray != NULL) {
+        printf("TEST ERROR: pmFindImagePeaks() returned a non-NULL psImage.\n");
+        testStatus = false;
+        psFree(tmpArray);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindImagePeaks with empty psImage.  Should generate error and return NULL.\n");
+    tmpArray = pmFindImagePeaks(tmpImageEmpty, 0.0);
+    if (tmpArray != NULL) {
+        printf("TEST ERROR: pmFindImagePeaks() returned a non-NULL psImage.\n");
+        testStatus = false;
+        psFree(tmpArray);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmFindImagePeaks with PS_TYPE_F64 psImage.  Should generate error and return NULL.\n");
+    tmpArray = pmFindImagePeaks(tmpImageF64, 0.0);
+    if (tmpArray != NULL) {
+        printf("TEST ERROR: pmFindImagePeaks() returned a non-NULL psImage.\n");
+        testStatus = false;
+        psFree(tmpArray);
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    //    testStatus&= test_pmFindImagePeaks(1, 1);
+    //    testStatus&= test_pmFindImagePeaks(2, 5);
+    //    testStatus&= test_pmFindImagePeaks(5, 2);
+    // HEY: add code for small images
+    //    testStatus&= test_pmFindImagePeaks(1, 1);
+    //    testStatus&= test_pmFindImagePeaks(1, 8);
+    //    testStatus&= test_pmFindImagePeaks(8, 1);
+    testStatus&= test_pmFindImagePeaks(TST02_NUM_ROWS,   TST02_NUM_COLS);
+    testStatus&= test_pmFindImagePeaks(2*TST02_NUM_ROWS, TST02_NUM_COLS);
+    testStatus&= test_pmFindImagePeaks(TST02_NUM_ROWS,   2*TST02_NUM_COLS);
+
+
+    psFree(tmpImageF64);
+    psFree(tmpImageEmpty);
+    return(testStatus);
+}
+
+/******************************************************************************
+test03(): We first test pmCullPeaks() with various NULL and unallowable input
+parameters.  Then we generate a list of peaks and test that pmCullPeaks()
+removes them correctly.
+ *****************************************************************************/
+int test03( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
+    psArray *outData = NULL;
+
+    /* XXX: Modify for new pmCullPeaks()
+            printf("----------------------------------------------------------------------------------\n");
+            printf("Calling pmCullPeaks with NULL psList.  Should generate error and return NULL.\n");
+            outData = pmCullPeaks(NULL, 0.0, NULL);
+            if (outData != NULL) {
+                printf("TEST ERROR: pmCulPeaks() returned a non-NULL psList.\n");
+                testStatus = false;
+        }
+    */
+
+    //
+    // Set peaks in input image.  All even-column and even-row pixels are
+    // set non-zero, all other pixels are set to zero.
+    //
+    psS32 numPeaksOrig = 0;
+    for (psS32 i = 0 ; i < NUM_ROWS ; i++) {
+        for (psS32 j = 0 ; j < NUM_COLS ; j++) {
+            if ((0 == i%2) && (0 == j%2)) {
+                imgData->data.F32[i][j] = (float) (i + 10);
+                numPeaksOrig++;
+            } else {
+                imgData->data.F32[i][j] = 0.0;
+            }
+        }
+    }
+    for (psS32 i = 0 ; i < NUM_ROWS ; i++) {
+        for (psS32 j = 0 ; j < NUM_COLS ; j++) {
+            printf("(%.1f) ", imgData->data.F32[i][j]);
+        }
+        printf("\n");
+    }
+    printf("Set %d peaks\n", numPeaksOrig);
+
+    //
+    // Call pmCullPeaks() with HUGE maxValue and NULL psRegion.  Should not
+    // remove any peaks.
+    //
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmCullPeaks with large maxValue and NULL psRegion.\n");
+    outData = pmFindImagePeaks(imgData, 0.0);
+    /* XXX: Modify for new pmCullPeaks
+        outData = pmCullPeaks(outData, PS_MAX_F32, NULL);
+
+        if (outData == NULL) {
+            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
+            testStatus = false;
+            return(testStatus);
+        }
+        if (outData->n != numPeaksOrig) {
+            printf("TEST ERROR (0): pmCullPeaks incorrectly removed peaks\n");
+            printf("The pmCullPeaks() output had %d peaks, should have had %d peaks.\n", outData->n, numPeaksOrig);
+            testStatus = false;
+        }
+    */
+    psFree(outData);
+
+    //
+    // Call pmCullPeaks() with TINY maxValue and NULL psRegion.  Should
+    // remove all peaks.
+    //
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmCullPeaks with tiny maxValue and NULL psRegion.\n");
+    outData = pmFindImagePeaks(imgData, 0.0);
+    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
+    /* XXX: Modify for new pmCullPeaks
+        outData = pmCullPeaks(outData, 0.0, NULL);
+
+        if (outData == NULL) {
+            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
+            testStatus = false;
+            return(testStatus);
+        }
+        if (outData->n != 0) {
+            printf("TEST ERROR (1): pmCullPeaks incorrectly removed peaks\n");
+            printf("The pmCullPeaks() output had %d peaks, should have had %d peaks.\n", outData->n, 0);
+            testStatus = false;
+        }
+        psFree(outData);
+    */
+
+    //
+    // Call pmCullPeaks() with HUGE maxValue and disjoint psRegion.  Should
+    // not remove any peaks.
+    //
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmCullPeaks with large maxValue and disjoint psRegion.\n");
+    outData = pmFindImagePeaks(imgData, 0.0);
+    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
+    psRegion tmpRegion = psRegionSet(10000.0, 20000.0, 10000.0, 20000.0);
+
+    /* XXX: Modify for new pmCullPeaks
+        outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion);
+
+        if (outData == NULL) {
+            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
+            testStatus = false;
+            return(testStatus);
+        }
+        if (outData->n != numPeaksOrig) {
+            printf("TEST ERROR (2): pmCullPeaks incorrectly removed peaks\n");
+            printf("The pmCullPeaks() output had %d peaks, should have had %d peaks.\n", outData->n, numPeaksOrig);
+            testStatus = false;
+        }
+    */
+    psFree(outData);
+
+    //
+    // Call pmCullPeaks() with HUGE maxValue and non-disjoint psRegion.  Should
+    // remove all peaks.
+    //
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmCullPeaks with large maxValue and non-disjoint psRegion.\n");
+    outData = pmFindImagePeaks(imgData, 0.0);
+    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
+    tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
+    /* XXX: Modify for new pmCullPeaks
+        outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion);
+
+        if (outData == NULL) {
+            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
+            testStatus = false;
+            return(testStatus);
+        }
+        if (outData->n != 0) {
+            printf("TEST ERROR (3): pmCullPeaks incorrectly removed peaks\n");
+            printf("The pmCullPeaks() output had %d peaks, should have had %d peaks.\n", outData->n, 0);
+            testStatus = false;
+        }
+    */
+    psFree(outData);
+
+    printf("----------------------------------------------------------------------------------\n");
+    psFree(imgData);
+    return(testStatus);
+}
+
+#define TST04_NUM_ROWS 100
+#define TST04_NUM_COLS 100
+#define TST04_SKY 20.0
+#define TST04_INNER_RADIUS 3
+#define TST04_OUTER_RADIUS 5
+/******************************************************************************
+test04(): We first test pmSourceLocalSky() with various NULL and unallowable
+input parameters.
+ 
+XXX: Should we produce tests with boundary numbers for the inner/outer radius?
+ 
+XXX: Call this with varying sizes for the image.
+ *****************************************************************************/
+int test04( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST04_NUM_COLS, TST04_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST04_SKY;
+        }
+    }
+    psImage *imgDataF64 = psImageAlloc(TST04_NUM_COLS, TST04_NUM_ROWS, PS_TYPE_F64);
+    for (psS32 i = 0 ; i < imgDataF64->numRows; i++) {
+        for (psS32 j = 0 ; j < imgDataF64->numCols; j++) {
+            imgDataF64->data.F64[i][j] = 0.0;
+        }
+    }
+    pmSource *rc = NULL;
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
+                                  (psF32) (TST04_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with NULL psImage.  Should generate error and return NULL.\n");
+    rc = pmSourceLocalSky(NULL, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+        psFree(rc);
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with wrong-type psImage.  Should generate error and return NULL.\n");
+    rc = pmSourceLocalSky(imgDataF64, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+        psFree(rc);
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with NULL pmPeak.  Should generate error and return NULL.\n");
+    rc = pmSourceLocalSky(imgData, NULL, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+        psFree(rc);
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with innerRadius<0.0.  Should generate error and return NULL.\n");
+    rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, -10.0, 20.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+        psFree(rc);
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with innerRadius>outerRadius.  Should generate error and return NULL.\n");
+    rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 5.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+        psFree(rc);
+        testStatus = false;
+    }
+    /* XXX: This is commented out since the EAM modification no longer generated NULLS for these tests.
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceLocalSky with subImage startRow < 0.  Should generate error and return NULL.\n");
+        tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+        tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+        tmpPeak->y = 1;
+        rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+        if (rc != NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+            psFree(rc);
+            testStatus = false;
+        }
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceLocalSky with subImage endRow > numRows.  Should generate error and return NULL.\n");
+        tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+        tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+        tmpPeak->y = TST04_NUM_ROWS;
+        rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+        if (rc != NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+            psFree(rc);
+            testStatus = false;
+        }
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceLocalSky with subImage startCol < 0.  Should generate error and return NULL.\n");
+        tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+        tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+        tmpPeak->x = 1;
+        rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
+        if (rc != NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+            psFree(rc);
+            testStatus = false;
+        }
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceLocalSky with subImage endCol > numCols.  Should generate error and return NULL.\n");
+        tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+        tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+        tmpPeak->x = TST04_NUM_COLS;
+        rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, (psF32) TST04_INNER_RADIUS, (psF32) TST04_OUTER_RADIUS);
+        if (rc != NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
+            psFree(rc);
+            testStatus = false;
+        }
+    */
+
+    //
+    // XXX: The following code should be a separate function, and we should call it
+    // with a variety of image sizes, peaks.
+    //
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+    rc = pmSourceLocalSky(imgData,
+                          tmpPeak,
+                          PS_STAT_SAMPLE_MEAN,
+                          (psF32) TST04_INNER_RADIUS,
+                          (psF32) TST04_OUTER_RADIUS);
+
+    if (rc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    } else {
+        if (rc->peak == NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->peak.\n");
+            testStatus = false;
+        } else {
+            if (rc->peak->x != tmpPeak->x) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->x was %d, should have been %d.\n", rc->peak->x, tmpPeak->x);
+                testStatus = false;
+            }
+
+            if (rc->peak->y != tmpPeak->y) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->y was %d, should have been %d.\n", rc->peak->y, tmpPeak->y);
+                testStatus = false;
+            }
+
+            if (rc->peak->counts != tmpPeak->counts) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->counts was %f, should have been %f.\n", rc->peak->counts, tmpPeak->counts);
+                testStatus = false;
+            }
+
+            if (rc->peak->class != tmpPeak->class) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->class was %d, should have been %d.\n", rc->peak->class, tmpPeak->class);
+                testStatus = false;
+            }
+        }
+
+        if (rc->pixels == NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels was NULL.\n");
+            testStatus = false;
+        } else {
+            if (rc->pixels->numRows != (2 * TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numRows was %d, should have been %d.\n",
+                       rc->pixels->numRows, (2 * TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->pixels->numCols != (2 * TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numCols was %d, should have been %d.\n",
+                       rc->pixels->numCols, (2 * TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->pixels->col0 != (tmpPeak->x - TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->col0 was %d, should have been %d.\n",
+                       rc->pixels->col0, (tmpPeak->x - TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->pixels->row0 != (tmpPeak->y - TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->row0 was %d, should have been %d.\n",
+                       rc->pixels->row0, (tmpPeak->y - TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->pixels->type.type != PS_TYPE_F32) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->type was %d, should have been %d.\n",
+                       rc->pixels->type.type, PS_TYPE_F32);
+                testStatus = false;
+            }
+
+            // XXX: Test the rc->pixels-> row/col offsets.
+            // XXX: Test that the pixels corresponds to the source image pixels.
+        }
+
+        if (rc->mask == NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() pmSource->mask was NULL.\n");
+            testStatus = false;
+        } else {
+            if (rc->mask->numRows != (2 * TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numRows was %d, should have been %d.\n",
+                       rc->mask->numRows, (2 * TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->mask->numCols != (2 * TST04_OUTER_RADIUS)) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numCols was %d, should have been %d.\n",
+                       rc->mask->numCols, (2 * TST04_OUTER_RADIUS));
+                testStatus = false;
+            }
+
+            if (rc->mask->type.type != PS_TYPE_U8) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->type was %d, should have been %d.\n",
+                       rc->mask->type.type, PS_TYPE_U8);
+                testStatus = false;
+            }
+
+            // XXX: Test the rc->mask-> row/col offsets.
+            // XXX: Test that the correct pixels were masked, not merely the number of masked pixels.
+            psS32 unmaskedPixels = 0;
+            psS32 maskedPixels = 0;
+
+            for (psS32 row = 0 ; row < rc->mask->numRows; row++) {
+                for (psS32 col = 0 ; col < rc->mask->numCols; col++) {
+                    if (rc->mask->data.U8[row][col] == 0) {
+                        unmaskedPixels++;
+                    } else {
+                        maskedPixels++;
+                    }
+                }
+            }
+            if (maskedPixels != PS_SQR(2*(TST04_INNER_RADIUS-1))) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n",
+                       maskedPixels, PS_SQR(2*(TST04_INNER_RADIUS-1)));
+                testStatus = false;
+            }
+            if (unmaskedPixels != (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1)))) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n",
+                       unmaskedPixels, (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1))));
+                testStatus = false;
+            }
+        }
+
+        if (rc->moments == NULL) {
+            printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->moments.\n");
+            testStatus = false;
+        } else {
+            if (rc->moments->Sky != TST04_SKY) {
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->moments->Sky was %f, should have been %f.\n", rc->moments->Sky, TST04_SKY);
+                testStatus = false;
+            }
+        }
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    psFree(rc);
+    psFree(imgData);
+    psFree(imgDataF64);
+    return(testStatus);
+}
+
+#define TST06_NUM_ROWS 100
+#define TST06_NUM_COLS 100
+#define TST06_SKY 20.0
+#define TST06_INNER_RADIUS 3
+#define TST06_OUTER_RADIUS 5
+/******************************************************************************
+test06(): We first test pmSourceLocalSky() with various NULL and unallowable
+input parameters.
+ 
+XXX: Should we produce tests with boundary numbers for the inner/outer radius?
+ 
+XXX: Call this with varying sizes for the image.
+ *****************************************************************************/
+int test06( void )
+{
+    bool testStatus = true;
+    pmSource *tmpSource = NULL;
+    bool rc = false;
+    // Create the image used in this test.
+    psImage *imgData = psImageAlloc(TST06_NUM_COLS, TST06_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST06_SKY;
+        }
+    }
+    psImage *imgDataF64 = psImageAlloc(TST06_NUM_COLS, TST06_NUM_ROWS, PS_TYPE_F64);
+    for (psS32 i = 0 ; i < imgDataF64->numRows; i++) {
+        for (psS32 j = 0 ; j < imgDataF64->numCols; j++) {
+            imgDataF64->data.F64[i][j] = 0.0;
+        }
+    }
+
+    //
+    // Create a pmPeak with the center pixel set to the peak.
+    //
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST06_NUM_ROWS / 2),
+                                  (psF32) (TST06_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    tmpSource = pmSourceLocalSky(imgData,
+                                 tmpPeak,
+                                 PS_STAT_SAMPLE_MEAN,
+                                 (psF32) TST06_INNER_RADIUS,
+                                 (psF32) TST06_OUTER_RADIUS);
+    if (tmpSource == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        psFree(imgData);
+        psFree(imgDataF64);
+        psFree(tmpSource);
+        testStatus = false;
+        return(testStatus);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSetPixelsCircle with NULL pmSource.  Should generate error and return NULL.\n");
+    rc = pmSourceSetPixelsCircle(NULL, imgData, 10.0);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+        testStatus = false;
+    }
+    // XXX: test with pmSource->peaks NULL
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSetPixelsCircle with NULL psImage.  Should generate error and return NULL.\n");
+    rc = pmSourceSetPixelsCircle(tmpSource, NULL, 10.0);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSetPixelsCircle with wrong type psImage.  Should generate error and return NULL.\n");
+    rc = pmSourceSetPixelsCircle(tmpSource, imgDataF64, 10.0);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSetPixelsCircle with radius < 0.0.  Should generate error and return NULL.\n");
+    rc = pmSourceSetPixelsCircle(tmpSource, imgData, -10.0);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    /* XXX: Commented away since the EAM mods no longer produced errors.
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceSetPixelsCircle with subImage startCol < 0.  Should generate error and return NULL.\n");
+        tmpSource->peak->x = (psF32) (TST06_NUM_ROWS / 2);
+        tmpSource->peak->y = (psF32) (TST06_NUM_COLS / 2);
+        tmpSource->peak->x = 1;
+        rc = pmSourceSetPixelsCircle(tmpSource, imgData, 10.0);
+        if (rc == true) {
+            printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+            testStatus = false;
+        }
+
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceSetPixelsCircle with subImage endCol > numCols.  Should generate error and return NULL.\n");
+        tmpSource->peak->x = (psF32) (TST06_NUM_ROWS / 2);
+        tmpSource->peak->y = (psF32) (TST06_NUM_COLS / 2);
+        tmpSource->peak->x = TST06_NUM_COLS;
+        rc = pmSourceSetPixelsCircle(tmpSource, imgData, 10.0);
+        if (rc == true) {
+            printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+            testStatus = false;
+        }
+
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceSetPixelsCircle with subImage startRow < 0.  Should generate error and return NULL.\n");
+        tmpSource->peak->x = (psF32) (TST06_NUM_ROWS / 2);
+        tmpSource->peak->y = (psF32) (TST06_NUM_COLS / 2);
+        tmpSource->peak->y = 1;
+        rc = pmSourceSetPixelsCircle(tmpSource, imgData, 10.0);
+        if (rc == true) {
+            printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+            testStatus = false;
+        }
+
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceSetPixelsCircle with subImage endRow > numRows.  Should generate error and return NULL.\n");
+        tmpSource->peak->x = (psF32) (TST06_NUM_ROWS / 2);
+        tmpSource->peak->y = (psF32) (TST06_NUM_COLS / 2);
+        tmpSource->peak->y = TST06_NUM_ROWS;
+        rc = pmSourceSetPixelsCircle(tmpSource, imgData, 10.0);
+        if (rc == true) {
+            printf("TEST ERROR: pmSourceSetPixelsCircle() returned TRUE.\n");
+            testStatus = false;
+        }
+    */
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSetPixelsCircle with valid data.\n");
+    tmpSource->peak->x = (psF32) (TST06_NUM_ROWS / 2);
+    tmpSource->peak->y = (psF32) (TST06_NUM_COLS / 2);
+    rc = pmSourceSetPixelsCircle(tmpSource, imgData, 10.0);
+
+    if (rc == false) {
+        printf("TEST ERROR: pmSourceSetPixelsCircle() returned FALSE.\n");
+        testStatus = false;
+    } else {
+        // XXX: Test correctness of the various psSetPixelsCircle members.
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    //    psFree(imgData);
+    //    psFree(imgDataF64);
+    psFree(tmpSource);
+    return(testStatus);
+
+}
+
+#define TST05_NUM_ROWS 100
+#define TST05_NUM_COLS 100
+#define TST05_SKY 20.0
+#define TST05_INNER_RADIUS 3
+#define TST05_OUTER_RADIUS 5
+/******************************************************************************
+test05(): We first test pmSourceMoments() with various NULL and unallowable
+input parameters.
+ 
+XXX: Should we produce tests with boundary numbers for the inner/outer radius?
+ 
+XXX: Call this with varying sizes for the image.
+ 
+XXX: The actual values of the moments are not tested.
+ *****************************************************************************/
+int test05( void )
+{
+    bool testStatus = true;
+    pmSource *tmpSource = NULL;
+    pmSource *rc = NULL;
+    // Create the image used in this test.
+    psImage *imgData = psImageAlloc(TST05_NUM_COLS, TST05_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST05_SKY;
+        }
+    }
+
+    //
+    // Create a pmPeak with the center pixel set to the peak.
+    //
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST05_NUM_ROWS / 2),
+                                  (psF32) (TST05_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    tmpSource = pmSourceLocalSky(imgData,
+                                 tmpPeak,
+                                 PS_STAT_SAMPLE_MEAN,
+                                 (psF32) TST05_INNER_RADIUS,
+                                 (psF32) TST05_OUTER_RADIUS);
+    if (tmpSource == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        psFree(tmpSource);
+        testStatus = false;
+        return(testStatus);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceMoments with NULL pmSource.  Should generate error and return NULL.\n");
+    rc = pmSourceMoments(NULL, 10.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n");
+        testStatus = false;
+    }
+    // XXX: test with pmSource->peaks NULL
+    // XXX: test with pmSource->pixels NULL
+    // XXX: test with pmSource->mask NULL
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceMoments with radius < 0.0.  Should generate error and return NULL.\n");
+    rc = pmSourceMoments(tmpSource, -10.0);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    psFree(tmpSource);
+    return(testStatus);
+
+}
+
+/******************************************************************************
+test07(): We first test the various psMinLM_... routines with various NULL and
+unallowable input parameters.
+ 
+XXX: We don't verify the numbers.  Must do this.
+ *****************************************************************************/
+int test07( void )
+{
+    bool testStatus = true;
+    psF32 rc;
+    psVector *deriv = psVectorAlloc(7, PS_TYPE_F32);
+    psVector *params = psVectorAlloc(7, PS_TYPE_F32);
+    psVector *x = psVectorAlloc(2, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 7 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Gauss2D with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_Gauss2D(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Gauss2D() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Gauss2D with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Gauss2D(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Gauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Gauss2D with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Gauss2D(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Gauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    psFree(deriv);
+    psFree(params);
+
+    deriv = psVectorAlloc(7, PS_TYPE_F32);
+    params = psVectorAlloc(7, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 7 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_PsuedoGauss2D with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_PsuedoGauss2D(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_PsuedoGauss2D() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_PsuedoGauss2D with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_PsuedoGauss2D(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_PsuedoGauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_PsuedoGauss2D with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_PsuedoGauss2D(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_PsuedoGauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    psFree(deriv);
+    psFree(params);
+
+
+    deriv = psVectorAlloc(9, PS_TYPE_F32);
+    params = psVectorAlloc(9, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 9 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Wauss2D with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_Wauss2D(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Wauss2D() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Wauss2D with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Wauss2D(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Wauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Wauss2D with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Wauss2D(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Wauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    psFree(deriv);
+    psFree(params);
+
+    deriv = psVectorAlloc(11, PS_TYPE_F32);
+    params = psVectorAlloc(11, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 11 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_TwistGauss2D with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_TwistGauss2D(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_TwistGauss2D() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_TwistGauss2D with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_TwistGauss2D(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_TwistGauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_TwistGauss2D with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_TwistGauss2D(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_TwistGauss2D() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    psFree(deriv);
+    psFree(params);
+
+    deriv = psVectorAlloc(8, PS_TYPE_F32);
+    params = psVectorAlloc(8, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 8 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Sersic with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_Sersic(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Sersic() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Sersic with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Sersic(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Sersic() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_Sersic with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_Sersic(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_Sersic() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    psFree(deriv);
+    psFree(params);
+
+    deriv = psVectorAlloc(12, PS_TYPE_F32);
+    params = psVectorAlloc(12, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < 12 ; i++) {
+        deriv->data.F32[i] = 1.0;
+        params->data.F32[i] = 1.0;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_SersicCore with NULL deriv vector.  Should not generate error.\n");
+    rc = pmMinLM_SersicCore(NULL, params, x);
+    if (isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_SersicCore() returned a NAN psF32.\n");
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_SersicCore with NULL params vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_SersicCore(deriv, NULL, x);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_SersicCore() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmMinLM_SersicCore with NULL x vector.  Should generate error and return NAN.\n");
+    rc = pmMinLM_SersicCore(deriv, params, NULL);
+    if (!isnan(rc)) {
+        printf("TEST ERROR: pmMinLM_SersicCore() returned a non-NAN psF32 (%f).\n", rc);
+        testStatus = false;
+    }
+
+    psFree(deriv);
+    psFree(params);
+    psFree(x);
+    return(testStatus);
+}
+
+/******************************************************************************
+test08(): We first test pmSourceModelGuess() with various NULL and unallowable
+input parameters.
+ 
+XXX: We don't verify the numbers.
+ *****************************************************************************/
+int test08( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST04_NUM_COLS, TST04_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST04_SKY;
+        }
+    }
+    pmSource *mySrc = NULL;
+    bool rc = false;
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
+                                  (psF32) (TST04_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST04_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST04_NUM_COLS / 2);
+    mySrc = pmSourceLocalSky(imgData,
+                             tmpPeak,
+                             PS_STAT_SAMPLE_MEAN,
+                             (psF32) TST04_INNER_RADIUS,
+                             (psF32) TST04_OUTER_RADIUS);
+
+    if (mySrc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with NULL pmSource.  Should generate error, return FALSE.\n");
+    rc = pmSourceModelGuess(NULL, imgData, PS_MODEL_GAUSS);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with NULL psImage.  Should generate error, return FALSE.\n");
+    rc = pmSourceModelGuess(mySrc, NULL, PS_MODEL_GAUSS);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with bad model type.  Should generate error, return FALSE.\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_UNDEFINED);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_GAUSS\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_GAUSS);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_PGAUSS\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_PGAUSS);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_TWIST_GAUSS\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_TWIST_GAUSS);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_WAUSS\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_WAUSS);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_SERSIC\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_SERSIC);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with PS_MODEL_SERSIC_CORE\n");
+    rc = pmSourceModelGuess(mySrc, imgData, PS_MODEL_SERSIC_CORE);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    psFree(mySrc);
+    //    psFree(tmpPeak);
+    psFree(imgData);
+    return(testStatus);
+}
+
+
+#define TST09_NUM_ROWS 70
+#define TST09_NUM_COLS 70
+#define TST09_SKY 5.0
+#define TST09_INNER_RADIUS 3
+#define TST09_OUTER_RADIUS 10
+#define LEVEL (TST09_SKY + 10.0)
+/******************************************************************************
+test09(): We first test pmSourceContour() with various NULL and unallowable
+input parameters.
+ 
+XXX: We don't verify the numbers.
+ *****************************************************************************/
+int test09( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST09_NUM_COLS, TST09_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST09_SKY;
+        }
+    }
+    pmSource *mySrc = NULL;
+    psArray *rc = NULL;
+
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST09_NUM_ROWS / 2),
+                                  (psF32) (TST09_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST09_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST09_NUM_COLS / 2);
+    mySrc = pmSourceLocalSky(imgData,
+                             tmpPeak,
+                             PS_STAT_SAMPLE_MEAN,
+                             (psF32) TST09_INNER_RADIUS,
+                             (psF32) TST09_OUTER_RADIUS);
+
+    if (mySrc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    bool rcBool = pmSourceModelGuess(mySrc, imgData, PS_MODEL_GAUSS);
+    if (rcBool != true) {
+        printf("TEST ERROR: pmSourceModelGuess() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceContour with NULL pmSource .  Should generate error, return NULL.\n");
+    rc = pmSourceContour(NULL, imgData, LEVEL, PS_CONTOUR_CRUDE);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceContour() returned non-NULL.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceContour with NULL psImage .  Should generate error, return NULL.\n");
+    rc = pmSourceContour(mySrc, NULL, LEVEL, PS_CONTOUR_CRUDE);
+    if (rc != NULL) {
+        printf("TEST ERROR: pmSourceContour() returned non-NULL.\n");
+        testStatus = false;
+        psFree(rc);
+    }
+
+    //
+    // XXX: pmSourceContour() has a problem with contour tops/bottoms.
+    // Must correct this.
+    //
+    if (0) {
+        printf("----------------------------------------------------------------------------------\n");
+        printf("Calling pmSourceContour with acceptable data.\n");
+        printf("NOTE: must figure out the parameters for this test to be meaningful.\n");
+        mySrc->modelPSF->params->data.F32[0] = TST09_SKY;
+        mySrc->modelPSF->params->data.F32[1] = 15.0;
+        mySrc->modelPSF->params->data.F32[2] = (psF32) (TST09_NUM_ROWS / 2);
+        mySrc->modelPSF->params->data.F32[3] = (psF32) (TST09_NUM_COLS / 2);
+        mySrc->modelPSF->params->data.F32[4] = 2.0;
+        mySrc->modelPSF->params->data.F32[5] = 2.0;
+        mySrc->modelPSF->params->data.F32[6] = 2.0;
+        rc = pmSourceContour(mySrc, imgData, LEVEL, PS_CONTOUR_CRUDE);
+        if (rc == NULL) {
+            printf("TEST ERROR: pmSourceContour() returned NULL.\n");
+            testStatus = false;
+        } else {
+            psFree(rc);
+        }
+    }
+
+    psFree(mySrc);
+    psFree(imgData);
+    // XXX: This psFree() causes an error.  Why?
+    //psFree(tmpPeak);
+    return(testStatus);
+}
+
+#define TST15_NUM_ROWS 100
+#define TST15_NUM_COLS 100
+#define TST15_SKY 10.0
+#define TST15_INNER_RADIUS 3
+#define TST15_OUTER_RADIUS 5
+/******************************************************************************
+test15(): We first test pmSourceAddModel() with various NULL and unallowable
+input parameters.
+ 
+XXX: We don't verify the numbers.
+ *****************************************************************************/
+int test15( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST15_NUM_COLS, TST15_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST15_SKY;
+        }
+    }
+    pmSource *mySrc = NULL;
+    psBool rc = false;
+
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST15_NUM_ROWS / 2),
+                                  (psF32) (TST15_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST15_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST15_NUM_COLS / 2);
+    mySrc = pmSourceLocalSky(imgData,
+                             tmpPeak,
+                             PS_STAT_SAMPLE_MEAN,
+                             (psF32) TST15_INNER_RADIUS,
+                             (psF32) TST15_OUTER_RADIUS);
+
+    if (mySrc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST15_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST15_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceAddModel with NULL psImage.  Should generate error, return FALSE.\n");
+    rc = pmSourceAddModel(NULL, mySrc, true);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceAddModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceAddModel with NULL psSrc.  Should generate error, return FALSE.\n");
+    rc = pmSourceAddModel(imgData, NULL, true);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceAddModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceAddModel with acceptable data.\n");
+    rc = pmSourceAddModel(imgData, mySrc, true);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceAddModel() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    psFree(mySrc);
+    psFree(imgData);
+    return(testStatus);
+}
+
+#define TST16_NUM_ROWS 100
+#define TST16_NUM_COLS 100
+#define TST16_SKY 10.0
+#define TST16_INNER_RADIUS 3
+#define TST16_OUTER_RADIUS 5
+/******************************************************************************
+test16(): We first test pmSourceSubModel() with various NULL and unallowable
+input parameters.
+ 
+XXX: We don't verify the numbers.
+ *****************************************************************************/
+int test16( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST16_NUM_COLS, TST16_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST16_SKY;
+        }
+    }
+    pmSource *mySrc = NULL;
+    psBool rc = false;
+
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2),
+                                  (psF32) (TST16_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST16_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST16_NUM_COLS / 2);
+    mySrc = pmSourceLocalSky(imgData,
+                             tmpPeak,
+                             PS_STAT_SAMPLE_MEAN,
+                             (psF32) TST16_INNER_RADIUS,
+                             (psF32) TST16_OUTER_RADIUS);
+
+    if (mySrc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST16_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST16_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSubModel with NULL psImage.  Should generate error, return FALSE.\n");
+    rc = pmSourceSubModel(NULL, mySrc, true);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSubModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSubModel with NULL psSrc.  Should generate error, return FALSE.\n");
+    rc = pmSourceSubModel(imgData, NULL, true);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceSubModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceSubModel with acceptable data.\n");
+    rc = pmSourceSubModel(imgData, mySrc, true);
+    if (rc != true) {
+        printf("TEST ERROR: pmSourceSubModel() returned FALSE.\n");
+        testStatus = false;
+    }
+
+    psFree(mySrc);
+    psFree(imgData);
+    return(testStatus);
+}
+
+#define TST20_NUM_ROWS 100
+#define TST20_NUM_COLS 100
+#define TST20_SKY 10.0
+#define TST20_INNER_RADIUS 3
+#define TST20_OUTER_RADIUS 5
+/******************************************************************************
+test20(): We first test pmSourceSubModel() with various NULL and unallowable
+input parameters.
+ 
+XXX: We don't verify the numbers.
+ *****************************************************************************/
+int test20( void )
+{
+    bool testStatus = true;
+    psImage *imgData = psImageAlloc(TST20_NUM_COLS, TST20_NUM_ROWS, PS_TYPE_F32);
+    for (psS32 i = 0 ; i < imgData->numRows; i++) {
+        for (psS32 j = 0 ; j < imgData->numCols; j++) {
+            imgData->data.F32[i][j] = TST20_SKY;
+        }
+    }
+    pmSource *mySrc = NULL;
+    psBool rc = false;
+
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2),
+                                  (psF32) (TST20_NUM_COLS / 2),
+                                  200.0,
+                                  PM_PEAK_LONE);
+
+    printf("Calling pmSourceLocalSky with valid data.\n");
+    tmpPeak->x = (psF32) (TST20_NUM_ROWS / 2);
+    tmpPeak->y = (psF32) (TST20_NUM_COLS / 2);
+    mySrc = pmSourceLocalSky(imgData,
+                             tmpPeak,
+                             PS_STAT_SAMPLE_MEAN,
+                             (psF32) TST20_INNER_RADIUS,
+                             (psF32) TST20_OUTER_RADIUS);
+
+    if (mySrc == NULL) {
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+
+
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST20_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST20_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceFitModel with NULL psImage.  Should generate error, return FALSE.\n");
+    rc = pmSourceFitModel(mySrc, NULL);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceFitModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceFitModel with NULL pmSource.  Should generate error, return FALSE.\n");
+    rc = pmSourceFitModel(NULL, imgData);
+    if (rc == true) {
+        printf("TEST ERROR: pmSourceFitModel() returned TRUE.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceFitModel with acceptable data.\n");
+    rc = pmSourceFitModel(mySrc, imgData);
+    printf("pmSourceFitModel returned %d\n", rc);
+
+    // XXX: Memory leaks are not being tested
+    psVector *junk = psVectorAlloc(10, PS_TYPE_F32);
+    junk->data.F32[0] = 0.0;
+
+    psFree(mySrc);
+    psFree(imgData);
+    return(testStatus);
+}
+
+
+// this code will
+
+
+
Index: /trunk/psModules/test/objects/verified/tst_pmObjects01.stderr
===================================================================
--- /trunk/psModules/test/objects/verified/tst_pmObjects01.stderr	(revision 5169)
+++ /trunk/psModules/test/objects/verified/tst_pmObjects01.stderr	(revision 5169)
@@ -0,0 +1,213 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: structure allocators and deallocators} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: structure allocators and deallocators} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: psFindVectorPeaks()}          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+    Unallowable operation: psVector vector or its data is NULL.
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+    Unallowable operation: psVector vector has no elements.
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+    Unallowable operation: psVector vector has incorrect type.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: psFindVectorPeaks()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: psFindImagePeaks()}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|psImageAlloc (FILE:LINENO)
+    Specified number of rows (0) or columns (0) is invalid.
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+    Unallowable operation: psImage image has incorrect type.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: psFindImagePeaks()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmCullPeaks()}                *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmCullPeaks()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceLocalSky()}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Unallowable operation: psImage image has incorrect type.
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Unallowable operation: peak is NULL.
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Error: (0.0 > innerRadius) (0.000000 -10.000000)
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Error: (innerRadius > outerRadius) (10.000000 5.000000)
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceLocalSky()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceSetPixelsCircle()}    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Unallowable operation: psImage image has incorrect type.
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Error: (0.0 > radius) (0.000000 -10.000000)
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSetPixelsCircle()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceMoments()}            *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceMoments (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceMoments (FILE:LINENO)
+    Error: (0.0 > radius) (0.000000 -10.000000)
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceMoments()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmMin()}                      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+    This function is not implemented yet.
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+    This function is not implemented yet.
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmMin()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceModelGuess()}         *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+    Undefined psModelType
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceModelGuess()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceContour()}            *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceContour (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceContour (FILE:LINENO)
+    Unallowable operation: image is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceContour()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceAddModel()}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: src is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceAddModel()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceSubModel()}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: src is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSubModel()} | tst_pmObjects01.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_pmObjects01.c                                          *
+*            TestPoint: Test Point Driver{pmObjects: pmSourceSubModel()}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|E|pmSourceFitModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceFitModel (FILE:LINENO)
+    Unallowable operation: source is NULL.
+
+---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSubModel()} | tst_pmObjects01.c)
+
Index: /trunk/psModules/test/objects/verified/tst_pmObjects01.stdout
===================================================================
--- /trunk/psModules/test/objects/verified/tst_pmObjects01.stdout	(revision 5169)
+++ /trunk/psModules/test/objects/verified/tst_pmObjects01.stdout	(revision 5169)
@@ -0,0 +1,188 @@
+Testing pmPeakAlloc()...
+Testing pmMomentsAlloc()...
+Testing pmModelAlloc(PS_MODEL_GAUSS)...
+Testing pmModelAlloc(PS_MODEL_PGAUSS)...
+Testing pmModelAlloc(PS_MODEL_TWIST_GAUSS)...
+Testing pmModelAlloc(PS_MODEL_WAUSS)...
+Testing pmModelAlloc(PS_MODEL_SERSIC)...
+Testing pmModelAlloc(PS_MODEL_SERSIC_CORE)...
+----------------------------------------------------------------------------------
+Calling pmFindVectorPeaks with NULL psVector.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmFindVectorPeaks with empty psVector.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmFindVectorPeaks with PS_TYPE_F64 psVector.  Should generate error and return NULL.
+-------------- Calling test_pmFindVectorPeaks on an 1 size vector. --------------
+Test pmFindVectorPeaks() with a first-element peak.
+Test pmFindVectorPeaks() with a first-element peak, large threshold.
+-------------- Calling test_pmFindVectorPeaks on an 10 size vector. --------------
+Test pmFindVectorPeaks() with a first-element peak.
+Test pmFindVectorPeaks() with a first-element peak, large threshold.
+Test pmFindVectorPeaks() with a last-element peak.
+Test pmFindVectorPeaks() with a last-element peak, large threshold.
+Test pmFindVectorPeaks() with all even-numbered elements peak.
+Test pmFindVectorPeaks() with all even-numbered elements peak, large threshold.
+----------------------------------------------------------------------------------
+Calling pmFindImagePeaks with NULL psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmFindImagePeaks with empty psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmFindImagePeaks with PS_TYPE_F64 psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+-------------- Calling test_pmFindImagePeaks on an 5-by-5 image. --------------
+(50.0) (5.0) (4.0) (5.0) (50.0) 
+(5.0) (2.0) (1.0) (2.0) (5.0) 
+(4.0) (1.0) (50.0) (1.0) (4.0) 
+(5.0) (2.0) (1.0) (2.0) (5.0) 
+(50.0) (5.0) (4.0) (5.0) (50.0) 
+-------------- Calling test_pmFindImagePeaks on an 10-by-5 image. --------------
+(125.0) (26.0) (25.0) (26.0) (125.0) 
+(20.0) (17.0) (16.0) (17.0) (20.0) 
+(13.0) (10.0) (9.0) (10.0) (13.0) 
+(8.0) (5.0) (4.0) (5.0) (8.0) 
+(5.0) (2.0) (1.0) (2.0) (5.0) 
+(4.0) (1.0) (125.0) (1.0) (4.0) 
+(5.0) (2.0) (1.0) (2.0) (5.0) 
+(8.0) (5.0) (4.0) (5.0) (8.0) 
+(13.0) (10.0) (9.0) (10.0) (13.0) 
+(125.0) (17.0) (16.0) (17.0) (125.0) 
+-------------- Calling test_pmFindImagePeaks on an 5-by-10 image. --------------
+(125.0) (20.0) (13.0) (8.0) (5.0) (4.0) (5.0) (8.0) (13.0) (125.0) 
+(26.0) (17.0) (10.0) (5.0) (2.0) (1.0) (2.0) (5.0) (10.0) (17.0) 
+(25.0) (16.0) (9.0) (4.0) (1.0) (125.0) (1.0) (4.0) (9.0) (16.0) 
+(26.0) (17.0) (10.0) (5.0) (2.0) (1.0) (2.0) (5.0) (10.0) (17.0) 
+(125.0) (20.0) (13.0) (8.0) (5.0) (4.0) (5.0) (8.0) (13.0) (125.0) 
+(10.0) (0.0) (10.0) (0.0) (10.0) (0.0) (10.0) (0.0) (10.0) (0.0) 
+(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
+(12.0) (0.0) (12.0) (0.0) (12.0) (0.0) (12.0) (0.0) (12.0) (0.0) 
+(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
+(14.0) (0.0) (14.0) (0.0) (14.0) (0.0) (14.0) (0.0) (14.0) (0.0) 
+(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
+(16.0) (0.0) (16.0) (0.0) (16.0) (0.0) (16.0) (0.0) (16.0) (0.0) 
+(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
+(18.0) (0.0) (18.0) (0.0) (18.0) (0.0) (18.0) (0.0) (18.0) (0.0) 
+(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
+Set 25 peaks
+----------------------------------------------------------------------------------
+Calling pmCullPeaks with large maxValue and NULL psRegion.
+----------------------------------------------------------------------------------
+Calling pmCullPeaks with tiny maxValue and NULL psRegion.
+pmFindImagePeaks found 25 peaks
+----------------------------------------------------------------------------------
+Calling pmCullPeaks with large maxValue and disjoint psRegion.
+pmFindImagePeaks found 25 peaks
+----------------------------------------------------------------------------------
+Calling pmCullPeaks with large maxValue and non-disjoint psRegion.
+pmFindImagePeaks found 25 peaks
+----------------------------------------------------------------------------------
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with NULL psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with wrong-type psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with NULL pmPeak.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with innerRadius<0.0.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with innerRadius>outerRadius.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+----------------------------------------------------------------------------------
+Calling pmSourceSetPixelsCircle with NULL pmSource.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceSetPixelsCircle with NULL psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceSetPixelsCircle with wrong type psImage.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceSetPixelsCircle with radius < 0.0.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceSetPixelsCircle with valid data.
+----------------------------------------------------------------------------------
+----------------------------------------------------------------------------------
+Calling pmSourceMoments with NULL pmSource.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceMoments with radius < 0.0.  Should generate error and return NULL.
+----------------------------------------------------------------------------------
+----------------------------------------------------------------------------------
+Calling pmMinLM_Gauss2D with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Gauss2D with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Gauss2D with NULL x vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_PsuedoGauss2D with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_PsuedoGauss2D with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_PsuedoGauss2D with NULL x vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Wauss2D with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Wauss2D with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Wauss2D with NULL x vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_TwistGauss2D with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_TwistGauss2D with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_TwistGauss2D with NULL x vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Sersic with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Sersic with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_Sersic with NULL x vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_SersicCore with NULL deriv vector.  Should not generate error.
+----------------------------------------------------------------------------------
+Calling pmMinLM_SersicCore with NULL params vector.  Should generate error and return NAN.
+----------------------------------------------------------------------------------
+Calling pmMinLM_SersicCore with NULL x vector.  Should generate error and return NAN.
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with NULL pmSource.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with NULL psImage.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with bad model type.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_GAUSS
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_PGAUSS
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_TWIST_GAUSS
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_WAUSS
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_SERSIC
+----------------------------------------------------------------------------------
+Calling pmSourceModelGuess with PS_MODEL_SERSIC_CORE
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+Calling pmSourceContour with NULL pmSource .  Should generate error, return NULL.
+----------------------------------------------------------------------------------
+Calling pmSourceContour with NULL psImage .  Should generate error, return NULL.
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+Calling pmSourceAddModel with NULL psImage.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceAddModel with NULL psSrc.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceAddModel with acceptable data.
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+Calling pmSourceSubModel with NULL psImage.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceSubModel with NULL psSrc.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceSubModel with acceptable data.
+Calling pmSourceLocalSky with valid data.
+----------------------------------------------------------------------------------
+Calling pmSourceFitModel with NULL psImage.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceFitModel with NULL pmSource.  Should generate error, return FALSE.
+----------------------------------------------------------------------------------
+Calling pmSourceFitModel with acceptable data.
+pmSourceFitModel returned 1
Index: /trunk/psModules/test/photom/Makefile.am
===================================================================
--- /trunk/psModules/test/photom/Makefile.am	(revision 5169)
+++ /trunk/psModules/test/photom/Makefile.am	(revision 5169)
@@ -0,0 +1,18 @@
+# Makefile for psModule tests
+
+AM_LDFLAGS = -L$(top_builddir)/src -lpsmodule $(PSMODULE_LIBS)
+AM_CFLAGS  = @AM_CFLAGS@ $(PSMODULE_CFLAGS) $(SRCINC)
+
+TESTS =
+
+check_PROGRAMS = $(TESTS)
+
+TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified
+
+tests: $(TESTS)
+
+EXTRA_DIST = verified
+
+CLEANFILES = $(TESTS) temp/*
+
+test: check
Index: unk/psModules/test/verified/tst_pmFlatField.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmFlatField.stderr	(revision 5168)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: Test Point Driver{pmFlatField}                             *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Null not allowed for flat readout.
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Null not allowed for input image.
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Null not allowed for flat image.
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image size exceeds that of flat image: (3, 3) vs (2, 2)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-<HOST>|E|pmFlatField (FILE:LINENO)
-    Input image mask size exceeds that of flat image: (5, 5) vs (3, 3)
-
----> TESTPOINT PASSED (Test Point Driver{pmFlatField} | tst_pmFlatField.c)
-
Index: unk/psModules/test/verified/tst_pmFlatField.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmFlatField.stdout	(revision 5168)
+++ 	(revision )
@@ -1,241 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test A - Divide input image by flat image}     *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-Input image:
-6.000000 6.000000 6.000000 
-6.000000 6.000000 6.000000 
-6.000000 6.000000 6.000000 
-
-Input mask:
-0 0 0 
-0 0 0 
-0 0 0 
-
-Flat image:
-2.000000 2.000000 2.000000 
-2.000000 2.000000 2.000000 
-2.000000 2.000000 2.000000 
-
-Resulting image:
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-
-
----> TESTPOINT PASSED (pmFlatField{Test A - Divide input image by flat image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test B - Mask flat image data}                 *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-Input image:
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-
-Flat image:
-0.000000 0.000000 0.000000 
-0.000000 0.000000 0.000000 
-0.000000 0.000000 0.000000 
-
-Resulting mask:
-8 8 8 
-8 8 8 
-8 8 8 
-
-Resulting image:
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-
-
----> TESTPOINT PASSED (pmFlatField{Test B - Mask flat image data} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test C - Mask flat image data starting with non-null mask} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-Input image:
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-
-Flat image:
-0.000000 0.000000 0.000000 
-0.000000 0.000000 0.000000 
-3.000000 -3.000000 0.000000 
-
-Flat image out:
-0.000000 0.000000 0.000000 
-0.000000 0.000000 0.000000 
-3.000000 0.000000 0.000000 
-
-Resulting mask:
-0 0 0 
-0 0 0 
-0 0 0 
-
-Resulting image:
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-3.000000 3.000000 3.000000 
-
-
----> TESTPOINT PASSED (pmFlatField{Test C - Mask flat image data starting with non-null mask} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test D - Attempt to use null flat readout}     *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Null not allowed for flat readout                          *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test D - Attempt to use null flat readout} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test E - Attempt to use null input image}      *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Null not allowed for input image                           *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test E - Attempt to use null input image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test F - Attempt tp use null flat image}       *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Null not allowed for flat image                            *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test F - Attempt tp use null flat image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test G - Attempt to use input image bigger than flat image} *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Input image size exceeds that of flat image                *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test G - Attempt to use input image bigger than flat image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test H - Attempt to use input image mask bigger than flat image} *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Input image mask size exceeds that of flat image           *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test H - Attempt to use input image mask bigger than flat image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test I - Attempt to use offset greater than input image} *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Total offset >= input image size                           *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test I - Attempt to use offset greater than input image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test J - Attempt to use complex input image}   *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Complex types not allowed for input image                  *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test J - Attempt to use complex input image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test K - Attempt to use complex flat image}    *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Complex types not allowed for flat image                   *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test K - Attempt to use complex flat image} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test L - Attempt to use non-equal input and flat image types} *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Input and flat image types differ                          *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test L - Attempt to use non-equal input and flat image types} | tst_pmFlatField.c)
-
-
-
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmFlatField.c                                          *
-*            TestPoint: pmFlatField{Test M - Attempt to use non-mask type mask image} *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Mask must be PS_TYPE_MASK type                             *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmFlatField{Test M - Attempt to use non-mask type mask image} | tst_pmFlatField.c)
-
-
-
-
Index: unk/psModules/test/verified/tst_pmImageCombine.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageCombine.stderr	(revision 5168)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmImageCombine.c                                       *
-*            TestPoint: Test Point Driver{pmCombineImages()}                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    Unallowable operation: images is NULL.
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    images and errors args must have same length (6 != 5)
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    Unallowable operation: psImage tmpDataImg has incorrect type.
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    images and errors args must have same length (5 != 6)
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    Unallowable operation: psImage tmpErrorImg has incorrect type.
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    images and masks args must have same length (5 != 6)
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    Unallowable operation: psImage tmpMaskImg has incorrect type.
-<HOST>|E|pmCombineImages (FILE:LINENO)
-    Unallowable operation: stats is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmCombineImages()} | tst_pmImageCombine.c)
-
Index: unk/psModules/test/verified/tst_pmImageCombine.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageCombine.stdout	(revision 5168)
+++ 	(revision )
@@ -1,47 +1,0 @@
-Testing pmCombineImages(10, 10, 5)
-Generating a bad pixel in image (1) at (0, 8)
-Generating a bad pixel in image (3) at (7, 5)
-Generating a bad pixel in image (1) at (1, 2)
-Generating a bad pixel in image (2) at (9, 9)
-Generating a bad pixel in image (1) at (3, 9)
-Generating a bad pixel in image (2) at (0, 5)
-Generating a bad pixel in image (1) at (4, 5)
-Generating a bad pixel in image (1) at (3, 8)
-Generating a bad pixel in image (2) at (6, 2)
-Generating a bad pixel in image (2) at (3, 7)
-Calling with a NULL images.  Should generate error, return NULL.
-Calling with a long images.  Should generate error, return NULL.
-Calling with a bad type images.  Should generate error, return NULL.
-Calling with a long errors.  Should generate error, return NULL.
-Calling with a bad type errors.  Should generate error, return NULL.
-Calling with a long masks.  Should generate error, return NULL.
-Calling with a bad type masks.  Should generate error, return NULL.
-Calling with a NULL stats.  Should generate error, return NULL.
-Calling with acceptable data.  Should generate a psImage.
-Image 1, questionable pixel 0 is (0 8)
-Image 1, questionable pixel 1 is (1 2)
-Image 1, questionable pixel 2 is (3 9)
-Image 1, questionable pixel 3 is (4 5)
-Image 1, questionable pixel 4 is (3 8)
-Image 2, questionable pixel 0 is (9 9)
-Image 2, questionable pixel 1 is (0 5)
-Image 2, questionable pixel 2 is (6 2)
-Image 2, questionable pixel 3 is (3 7)
-Image 3, questionable pixel 0 is (7 5)
-
-
-
-Calling pmRejectPixels() with acceptable data.  Should generate a psArray.
-tst_pmImageCombine.c: Image 0 had 0 rejects.
-tst_pmImageCombine.c: Image 1 had 4 rejects.
-Image 1, rejected pixel 0 is (0 8)
-Image 1, rejected pixel 1 is (1 2)
-Image 1, rejected pixel 2 is (4 5)
-Image 1, rejected pixel 3 is (3 8)
-tst_pmImageCombine.c: Image 2 had 3 rejects.
-Image 2, rejected pixel 0 is (0 5)
-Image 2, rejected pixel 1 is (6 2)
-Image 2, rejected pixel 2 is (3 7)
-tst_pmImageCombine.c: Image 3 had 1 rejects.
-Image 3, rejected pixel 0 is (7 5)
-tst_pmImageCombine.c: Image 4 had 0 rejects.
Index: unk/psModules/test/verified/tst_pmImageSubtract.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageSubtract.stderr	(revision 5168)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmImageSubtract.c                                      *
-*            TestPoint: Test Point Driver{pmSubtractionKernelsAllocPOIS()}         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractionKernelsAllocPOIS()} | tst_pmImageSubtract.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmImageSubtract.c                                      *
-*            TestPoint: Test Point Driver{pmSubtractionKernelsAllocISIS()}         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractionKernelsAllocISIS()} | tst_pmImageSubtract.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmImageSubtract.c                                      *
-*            TestPoint: Test Point Driver{pmSubtractionFindStamps()}               *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: xNum is 0 or less.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: yNum is 0 or less.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: border is 0 or less.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: xNum is 0 or less.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: yNum is 0 or less.
-<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
-    Error: border is 0 or less.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractionFindStamps()} | tst_pmImageSubtract.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmImageSubtract.c                                      *
-*            TestPoint: Test Point Driver{pmSubtractionCalculateEquation()}        *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: stamps is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: psImage reference or its data is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: psImage input or its data is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: kernels is NULL.
-<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
-    Unallowable operation: stamps is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Unallowable operation: psVector solution or its data is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Unallowable operation: kernels is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: stamps is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: psImage reference or its data is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: psImage input or its data is NULL.
-<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
-    Unallowable operation: kernels is NULL.
-<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
-    Unallowable operation: stamps is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Unallowable operation: psVector solution or its data is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Unallowable operation: kernels is NULL.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
-    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractionCalculateEquation()} | tst_pmImageSubtract.c)
-
Index: unk/psModules/test/verified/tst_pmImageSubtract.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageSubtract.stdout	(revision 5168)
+++ 	(revision )
@@ -1,73 +1,0 @@
-Testing pmSubtractionKernelsAllocPOIS(1, 1)
-Testing pmSubtractionKernelsAllocPOIS(2, 3)
-Testing pmSubtractionKernelsAllocPOIS(3, 4)
-Testing pmSubtractionFindStamps(100, 100, 2, 2, 2)
-Calling with a NULL psImage.  Should generate error, return NULL.
-Calling with a non-positive xNum.  Should generate error, return NULL.
-Calling with a non-positive yNum.  Should generate error, return NULL.
-Calling with a non-positive border.  Should generate error, return NULL.
-Calling with acceptable input parameters, non-NULL mask.
-Calling with acceptable input parameters, NULL mask.
-Testing pmSubtractionFindStamps(100, 100, 10, 10, 2)
-Calling with a NULL psImage.  Should generate error, return NULL.
-Calling with a non-positive xNum.  Should generate error, return NULL.
-Calling with a non-positive yNum.  Should generate error, return NULL.
-Calling with a non-positive border.  Should generate error, return NULL.
-Calling with acceptable input parameters, non-NULL mask.
-Calling with acceptable input parameters, NULL mask.
-Testing pmSubtractionCalculateEquation(): 
-    image size is (25, 25)
-    num stamps is (2, 2).  Border is 2
-   kernel type is PM_SUBTRACTION_KERNEL_POIS.
-Generating stamps...
-Generating kernel basis functions...
-Calling with a NULL psArray stamps.  Should generate error, return FALSE.
-Calling with a NULL reference images.  Should generate error, return FALSE.
-Calling with a NULL input images.  Should generate error, return FALSE.
-Calling with a NULL kernel basis functions.  Should generate error, return FALSE.
-Calling with acceptable input parameters.  Should return TRUE.
-Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
-Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
-The solution vector is:
-(-3866492.76) (-520094.85) (-1277345.36) (-481569.41) (0.21) (-1182727.56) (0.01) (0.01) (-0.00) (-0.02) (-0.00) (0.00) (-0.01) (0.01) (-0.00) (-0.01) (0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.01) (0.01) (-0.03) (0.01) (0.00) (-0.01) (0.00) (0.00) (0.01) (-0.01) (-0.02) (0.00) (0.01) (0.01) (-0.01) (0.01) (-0.00) (-0.01) (0.00) (0.01) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (0.04) (-0.02) (-0.02) (0.01) (0.02) (0.01) (-0.03) (0.03) (0.02) (-0.02) (-0.01) (-0.01) (-0.01) (0.01) (0.00) (-0.01) (0.00) (0.00) (-0.02) (0.01) (0.01) (-0.01) (0.00) (-0.00) (-0.01) (-0.02) (0.01) (0.02) (0.02) (-0.01) (0.04) (0.00) (-0.01) (-0.01) (-0.02) (-0.00) (0.00) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.00) (-0.01) (-0.02) (0.02) (0.02) (0.02) (0.01) (-0.01) (-0.02) (0.01) (0.01) (0.02) (0.03) (-0.00) (-0.05) (-0.00) (0.01) (0.05) (-0.04) (0.03) (0.03) (-0.03) (-0.04) (-0.02) (-0.02) (-0.00) (0.00) (0.01) (0.00) (0.00) (-0.02) (0.01) (0.01) (-0.00) (-0.00) (-0.01) (-0.03) (0.02) (0.01) (-0.02) (-0.01) (-0.00) (0.01) (-0.01) (-0.02) (0.01) (0.00) (0.02) (-0.03) (0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.02) (-0.02) (0.02) (0.01) (0.02) (0.49) 
-Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
-Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
--0.001170 -0.025330 0.003882 -0.024851 -0.014656 
--0.019844 -0.032570 0.014897 0.002807 0.000729 
-0.002328 0.031599 -5181287.500000 -0.004433 -0.013596 
--0.008172 -0.016571 0.033990 -0.012052 -0.002317 
-0.010558 -0.020875 0.011541 -0.006648 0.006954 
-Testing pmSubtractionCalculateEquation(): 
-    image size is (25, 25)
-    num stamps is (2, 2).  Border is 2
-   kernel type is PM_SUBTRACTION_KERNEL_ISIS.
-Generating stamps...
-Generating kernel basis functions...
-Calling with a NULL psArray stamps.  Should generate error, return FALSE.
-Calling with a NULL reference images.  Should generate error, return FALSE.
-Calling with a NULL input images.  Should generate error, return FALSE.
-Calling with a NULL kernel basis functions.  Should generate error, return FALSE.
-Calling with acceptable input parameters.  Should return TRUE.
-Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
-Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
-The solution vector is:
-(0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (0.55) 
-Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
-Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable x value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
-Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
-0.031614 0.045997 0.052122 0.045997 0.031614 
-0.045997 0.066926 0.075837 0.066926 0.045997 
-0.052122 0.075837 0.085934 0.075837 0.052122 
-0.045997 0.066926 0.075837 0.066926 0.045997 
-0.031614 0.045997 0.052122 0.045997 0.031614 
Index: unk/psModules/test/verified/tst_pmMaskBadPixels.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmMaskBadPixels.stderr	(revision 5168)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on maskVal argument} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on maskVal argument} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on saturation argument} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on saturation argument} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Create mask based on growVal and grow argum *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Create mask based on growVal and grow arguments} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Auto create mask based on maskVal argument} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Auto create mask based on maskVal argument} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use null mask} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Null not allowed for mask image.
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use null mask} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt tp use null input image} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Null not allowed for input image.
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt tp use null input image} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use input image bigger than mask *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Input image size exceeds that of mask image: (60, 60) vs (50, 50)
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use input image bigger than mask} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use input image mask bigger than *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Input image mask size exceeds that of mask image: (60, 60) vs (50, 50)
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use input image mask bigger than mask} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use offset greater than input im *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Total offset >= mask image: (150, 150) vs (50, 50)
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use offset greater than input image} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use complex input image} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Complex types not allowed for input image. Type: 2064
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use complex input image} | tst_pmMaskBadPixels.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmMaskBadPixels.c                                      *
-*            TestPoint: Test Point Driver{pmMaskBadPixels - Attempt to use non-mask type mask image} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMaskBadPixels (FILE:LINENO)
-    Mask must be PS_TYPE_MASK type. Type: 1032
-
----> TESTPOINT PASSED (Test Point Driver{pmMaskBadPixels - Attempt to use non-mask type mask image} | tst_pmMaskBadPixels.c)
-
Index: unk/psModules/test/verified/tst_pmMaskBadPixels.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmMaskBadPixels.stdout	(revision 5168)
+++ 	(revision )
@@ -1,416 +1,0 @@
-Data mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000010000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
-Resulting mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000010000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
-Data mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
-Resulting mask:
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-44444444444444444444444444444444444444444444444444
-
-Data mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000010000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00010000000000000000000000000000000000000000001000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
-Resulting mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000011111110000000000000000000000
-00000000000000000001111111111100000000000000000000
-00000000000000000011111111111110000000000000000000
-00000000000000000111111111111111000000000000000000
-00000000000000001111111111111111100000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000001111111111111111100000000000000000
-00000000000000000111111111111111000000000000000000
-00000000000000000011111111111110000000000000000000
-00000000000000000001111111111100000000000000000000
-11111110000000000000011111110000000000000001111111
-11111111100000000000000000000000000000000111111111
-11111111110000000000000000000000000000001111111111
-11111111111000000000000000000000000000011111111111
-11111111111100000000000000000000000000111111111111
-11111111111110000000000000000000000001111111111111
-11111111111110000000000000000000000001111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111111000000000000000000000011111111111111
-11111111111110000000000000000000000001111111111111
-
-Data mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000010000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
-Resulting mask:
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000011111110000000000000000000000
-00000000000000000001111111111100000000000000000000
-00000000000000000011111111111110000000000000000000
-00000000000000000111111111111111000000000000000000
-00000000000000001111111111111111100000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000111111111111111111111000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000011111111111111111110000000000000000
-00000000000000001111111111111111100000000000000000
-00000000000000000111111111111111000000000000000000
-00000000000000000011111111111110000000000000000000
-00000000000000000001111111111100000000000000000000
-00000000000000000000011111110000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000
-
Index: unk/psModules/test/verified/tst_pmNonLinear.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmNonLinear.stderr	(revision 5168)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: Test Point Driver{pmNonLinearityPolynomial}                *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmNonLinearityPolynomial} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: Test Point Driver{pmNonLinearityLookup}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: Test Point Driver{pmNonLinearityPolynomial(): error/warning conditions} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
-    Unallowable operation: inputReadout is NULL.
-<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
-    Unallowable operation: inputReadout->image is NULL.
-<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
-    Unallowable operation: input1DPoly is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmNonLinearityPolynomial(): error/warning conditions} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: Test Point Driver{pmNonLinearityLookup(): error/warning conditions} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
-    Unallowable operation: inputReadout is NULL.
-<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
-    Unallowable operation: inputReadout->image is NULL.
-<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
-    Unallowable operation: inFlux is NULL.
-<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
-    Unallowable operation: outFlux is NULL.
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 25)
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 23)
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 24)
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 24)
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 25)
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 23)
-<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
-    pmNonLinearityLookup(): input vector less than 2 elements.  Returning inputReadout image.
-<HOST>|W|vectorBinDisectF32
-    vectorBinDisectF32(): ordinate -1.000000 is outside vector range (0.000000 - 23.000000).
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
-<HOST>|W|vectorBinDisectF32
-    vectorBinDisectF32(): ordinate 100.000000 is outside vector range (0.000000 - 23.000000).
-<HOST>|W|pmNonLinearityLookup
-    WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
-
----> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup(): error/warning conditions} | tst_pmNonLinear.c)
-
Index: unk/psModules/test/verified/tst_pmNonLinear.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmNonLinear.stdout	(revision 5168)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityPolynomialTest}                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityPolynomialTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{doNonLinearityLookupTest}                      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmNonLinear{doNonLinearityLookupTest} | tst_pmNonLinear.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmNonLinear.c                                          *
-*            TestPoint: pmNonLinear{Testing bad input parameter conditions.}       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-------------------------------------------------------------
-Calling pmNonLinearityPolynomial() with NULL input readout.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityPolynomial() with NULL input readout->image.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityPolynomial() with NULL polynomial.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL input pmReadout.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL input pmReadout->image.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL inFlux psVector.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL outFlux psVector.  Should generate error, return NULL.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original pmReadout.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
-------------------------------------------------------------
-Calling pmNonLinearityLookup() with image values not in vector.
-
----> TESTPOINT PASSED (pmNonLinear{Testing bad input parameter conditions.} | tst_pmNonLinear.c)
-
Index: unk/psModules/test/verified/tst_pmObjects01.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmObjects01.stderr	(revision 5168)
+++ 	(revision )
@@ -1,213 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: structure allocators and deallocators} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: structure allocators and deallocators} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: psFindVectorPeaks()}          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
-    Unallowable operation: psVector vector or its data is NULL.
-<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
-    Unallowable operation: psVector vector has no elements.
-<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
-    Unallowable operation: psVector vector has incorrect type.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: psFindVectorPeaks()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: psFindImagePeaks()}           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|psImageAlloc (FILE:LINENO)
-    Specified number of rows (0) or columns (0) is invalid.
-<HOST>|E|pmFindImagePeaks (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmFindImagePeaks (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmFindImagePeaks (FILE:LINENO)
-    Unallowable operation: psImage image has incorrect type.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: psFindImagePeaks()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmCullPeaks()}                *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmCullPeaks()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceLocalSky()}           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Unallowable operation: psImage image has incorrect type.
-<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Unallowable operation: peak is NULL.
-<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Error: (0.0 > innerRadius) (0.000000 -10.000000)
-<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Error: (innerRadius > outerRadius) (10.000000 5.000000)
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceLocalSky()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceSetPixelsCircle()}    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Unallowable operation: psImage image has incorrect type.
-<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Error: (0.0 > radius) (0.000000 -10.000000)
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSetPixelsCircle()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceMoments()}            *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceMoments (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<HOST>|E|pmSourceMoments (FILE:LINENO)
-    Error: (0.0 > radius) (0.000000 -10.000000)
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceMoments()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmMin()}                      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
-    This function is not implemented yet.
-<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
-    This function is not implemented yet.
-<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmMin()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceModelGuess()}         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceModelGuess (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<HOST>|E|pmSourceModelGuess (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSourceModelGuess (FILE:LINENO)
-    Undefined psModelType
-<HOST>|W|pmSourceModelGuess
-    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
-<HOST>|W|pmSourceModelGuess
-    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
-<HOST>|W|pmSourceModelGuess
-    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
-<HOST>|W|pmSourceModelGuess
-    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
-<HOST>|W|pmSourceModelGuess
-    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceModelGuess()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceContour()}            *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceContour (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<HOST>|E|pmSourceContour (FILE:LINENO)
-    Unallowable operation: image is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceContour()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceAddModel()}           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: src is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceAddModel()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceSubModel()}           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: src is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSubModel()} | tst_pmObjects01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmObjects01.c                                          *
-*            TestPoint: Test Point Driver{pmObjects: pmSourceSubModel()}           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSourceFitModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<HOST>|E|pmSourceFitModel (FILE:LINENO)
-    Unallowable operation: source is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceSubModel()} | tst_pmObjects01.c)
-
Index: unk/psModules/test/verified/tst_pmObjects01.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmObjects01.stdout	(revision 5168)
+++ 	(revision )
@@ -1,188 +1,0 @@
-Testing pmPeakAlloc()...
-Testing pmMomentsAlloc()...
-Testing pmModelAlloc(PS_MODEL_GAUSS)...
-Testing pmModelAlloc(PS_MODEL_PGAUSS)...
-Testing pmModelAlloc(PS_MODEL_TWIST_GAUSS)...
-Testing pmModelAlloc(PS_MODEL_WAUSS)...
-Testing pmModelAlloc(PS_MODEL_SERSIC)...
-Testing pmModelAlloc(PS_MODEL_SERSIC_CORE)...
-----------------------------------------------------------------------------------
-Calling pmFindVectorPeaks with NULL psVector.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmFindVectorPeaks with empty psVector.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmFindVectorPeaks with PS_TYPE_F64 psVector.  Should generate error and return NULL.
--------------- Calling test_pmFindVectorPeaks on an 1 size vector. --------------
-Test pmFindVectorPeaks() with a first-element peak.
-Test pmFindVectorPeaks() with a first-element peak, large threshold.
--------------- Calling test_pmFindVectorPeaks on an 10 size vector. --------------
-Test pmFindVectorPeaks() with a first-element peak.
-Test pmFindVectorPeaks() with a first-element peak, large threshold.
-Test pmFindVectorPeaks() with a last-element peak.
-Test pmFindVectorPeaks() with a last-element peak, large threshold.
-Test pmFindVectorPeaks() with all even-numbered elements peak.
-Test pmFindVectorPeaks() with all even-numbered elements peak, large threshold.
-----------------------------------------------------------------------------------
-Calling pmFindImagePeaks with NULL psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmFindImagePeaks with empty psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmFindImagePeaks with PS_TYPE_F64 psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
--------------- Calling test_pmFindImagePeaks on an 5-by-5 image. --------------
-(50.0) (5.0) (4.0) (5.0) (50.0) 
-(5.0) (2.0) (1.0) (2.0) (5.0) 
-(4.0) (1.0) (50.0) (1.0) (4.0) 
-(5.0) (2.0) (1.0) (2.0) (5.0) 
-(50.0) (5.0) (4.0) (5.0) (50.0) 
--------------- Calling test_pmFindImagePeaks on an 10-by-5 image. --------------
-(125.0) (26.0) (25.0) (26.0) (125.0) 
-(20.0) (17.0) (16.0) (17.0) (20.0) 
-(13.0) (10.0) (9.0) (10.0) (13.0) 
-(8.0) (5.0) (4.0) (5.0) (8.0) 
-(5.0) (2.0) (1.0) (2.0) (5.0) 
-(4.0) (1.0) (125.0) (1.0) (4.0) 
-(5.0) (2.0) (1.0) (2.0) (5.0) 
-(8.0) (5.0) (4.0) (5.0) (8.0) 
-(13.0) (10.0) (9.0) (10.0) (13.0) 
-(125.0) (17.0) (16.0) (17.0) (125.0) 
--------------- Calling test_pmFindImagePeaks on an 5-by-10 image. --------------
-(125.0) (20.0) (13.0) (8.0) (5.0) (4.0) (5.0) (8.0) (13.0) (125.0) 
-(26.0) (17.0) (10.0) (5.0) (2.0) (1.0) (2.0) (5.0) (10.0) (17.0) 
-(25.0) (16.0) (9.0) (4.0) (1.0) (125.0) (1.0) (4.0) (9.0) (16.0) 
-(26.0) (17.0) (10.0) (5.0) (2.0) (1.0) (2.0) (5.0) (10.0) (17.0) 
-(125.0) (20.0) (13.0) (8.0) (5.0) (4.0) (5.0) (8.0) (13.0) (125.0) 
-(10.0) (0.0) (10.0) (0.0) (10.0) (0.0) (10.0) (0.0) (10.0) (0.0) 
-(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
-(12.0) (0.0) (12.0) (0.0) (12.0) (0.0) (12.0) (0.0) (12.0) (0.0) 
-(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
-(14.0) (0.0) (14.0) (0.0) (14.0) (0.0) (14.0) (0.0) (14.0) (0.0) 
-(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
-(16.0) (0.0) (16.0) (0.0) (16.0) (0.0) (16.0) (0.0) (16.0) (0.0) 
-(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
-(18.0) (0.0) (18.0) (0.0) (18.0) (0.0) (18.0) (0.0) (18.0) (0.0) 
-(0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) (0.0) 
-Set 25 peaks
-----------------------------------------------------------------------------------
-Calling pmCullPeaks with large maxValue and NULL psRegion.
-----------------------------------------------------------------------------------
-Calling pmCullPeaks with tiny maxValue and NULL psRegion.
-pmFindImagePeaks found 25 peaks
-----------------------------------------------------------------------------------
-Calling pmCullPeaks with large maxValue and disjoint psRegion.
-pmFindImagePeaks found 25 peaks
-----------------------------------------------------------------------------------
-Calling pmCullPeaks with large maxValue and non-disjoint psRegion.
-pmFindImagePeaks found 25 peaks
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with NULL psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with wrong-type psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with NULL pmPeak.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with innerRadius<0.0.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with innerRadius>outerRadius.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with NULL pmSource.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with NULL psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with wrong type psImage.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with radius < 0.0.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with valid data.
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-Calling pmSourceMoments with NULL pmSource.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceMoments with radius < 0.0.  Should generate error and return NULL.
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-Calling pmMinLM_Gauss2D with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Gauss2D with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Gauss2D with NULL x vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_PsuedoGauss2D with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_PsuedoGauss2D with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_PsuedoGauss2D with NULL x vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Wauss2D with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Wauss2D with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Wauss2D with NULL x vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_TwistGauss2D with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_TwistGauss2D with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_TwistGauss2D with NULL x vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Sersic with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Sersic with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_Sersic with NULL x vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_SersicCore with NULL deriv vector.  Should not generate error.
-----------------------------------------------------------------------------------
-Calling pmMinLM_SersicCore with NULL params vector.  Should generate error and return NAN.
-----------------------------------------------------------------------------------
-Calling pmMinLM_SersicCore with NULL x vector.  Should generate error and return NAN.
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with NULL pmSource.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with NULL psImage.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with bad model type.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_GAUSS
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_PGAUSS
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_TWIST_GAUSS
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_WAUSS
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_SERSIC
-----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with PS_MODEL_SERSIC_CORE
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-Calling pmSourceContour with NULL pmSource .  Should generate error, return NULL.
-----------------------------------------------------------------------------------
-Calling pmSourceContour with NULL psImage .  Should generate error, return NULL.
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-Calling pmSourceAddModel with NULL psImage.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceAddModel with NULL psSrc.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceAddModel with acceptable data.
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-Calling pmSourceSubModel with NULL psImage.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceSubModel with NULL psSrc.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceSubModel with acceptable data.
-Calling pmSourceLocalSky with valid data.
-----------------------------------------------------------------------------------
-Calling pmSourceFitModel with NULL psImage.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceFitModel with NULL pmSource.  Should generate error, return FALSE.
-----------------------------------------------------------------------------------
-Calling pmSourceFitModel with acceptable data.
-pmSourceFitModel returned 1
Index: unk/psModules/test/verified/tst_pmReadoutCombine.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmReadoutCombine.stderr	(revision 5168)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: Test Point Driver{pmSubtractBias(): Basic readout combines with no image overla *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias(): Basic readout combines with no image overlap} | tst_pmReadoutCombine.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: Test Point Driver{pmSubtractBias(): input parameter error conditions} *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    zero vector has incorrect size (5).  Returning NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Unallowable operation: psVector zero has incorrect type.
-<HOST>|W|pmReadoutCombine
-    WARNING: the zero vector too many elements (11)
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    scale vector has incorrect size (5).  Returning NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Unallowable operation: psVector scale has incorrect type.
-<HOST>|W|pmReadoutCombine
-    WARNING: the scale vector has too many elements (20)
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Output image (1, 1) is too small to hold combined images.  Returning NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Output image offset is larger then input image offset.  Returning NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Unallowable operation: inputs is NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Unallowable operation: params is NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Multiple statistical options have been requested.  Returning NULL.
-<HOST>|E|pmReadoutCombine (FILE:LINENO)
-    Unallowable operation: params->stats is NULL.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias(): input parameter error conditions} | tst_pmReadoutCombine.c)
-
Index: unk/psModules/test/verified/tst_pmReadoutCombine.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmReadoutCombine.stdout	(revision 5168)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (1, 1)
-
----> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (1, 20)
-
----> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (20, 1)
-
----> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: pmReadoutCombine{simpleCombineNoOverlap}                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (0, 0) (20, 20)
-
----> TESTPOINT PASSED (pmReadoutCombine{simpleCombineNoOverlap} | tst_pmReadoutCombine.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmReadoutCombine.c                                     *
-*            TestPoint: pmReadoutCombine{Testing bad input parameter conditions}   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with NULL zero vector.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect length zero vector (too small).  Should generate error.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect type zero vector.  Should generate error.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect length zero vector (too big).  Should generate warning.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with NULL scale vector.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect length scale vector (too small).  Should generate error.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect type scale vector.  Should generate error.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with incorrect length scale vector (too big).  Should generate warning.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() insufficient size output image.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() row0/col0 too large.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with NULL input list.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with NULL params.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with multiple stats->options.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-Calling pmReadoutCombine() with NULL param->stats.  Should generate error, return NULL.
-----------------------------------------------------------------------------
-============================================================================
-
----> TESTPOINT PASSED (pmReadoutCombine{Testing bad input parameter conditions} | tst_pmReadoutCombine.c)
-
Index: unk/psModules/test/verified/tst_pmSubtractBias.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractBias.stderr	(revision 5168)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    (overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE).  Returning in image
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals NONE and overscans does not equal NULL.  Proceeding to full fram subtraction.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals NONE, and fit does not equal NONE.  Proceeding to full fram subtraction.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals NONE, and fit does not equal NONE.  Proceeding to full fram subtraction.
-<HOST>|W|GenNewStatOptions
-    WARNING: pmSubtractBias.c: GenNewStatOptions(): Too many statistics options have been specified
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    Don't know how to scale the overscan vector.  Set fit to PM_FIT_SPLINE or PM_FIT_POLYNOMIAL.  Returning in image.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    Don't know how to scale the overscan vector.  Set fit to PM_FIT_SPLINE or PM_FIT_POLYNOMIAL.  Returning in image.
-<HOST>|E|SubtractFrame (FILE:LINENO)
-    bias image does not have enough rows.  Returning in image
-<HOST>|E|SubtractFrame (FILE:LINENO)
-    bias image does not have enough columns.  Returning in image
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    fit is unallowable (54321).  Returning in image.
-<HOST>|E|pmSubtractBias (FILE:LINENO)
-    overScanAxis is unallowable (54321).  Returning in image.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: Test Point Driver{pmSubtractBias}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 rows, input image has 8 rows
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overscan image has 7 columns, input image has 8 columns
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-<HOST>|W|pmSubtractBias
-    WARNING: pmSubtractBias.(): overScanAxis equals ALL, and fit does not equal NONE.  Proceeding with the rest of the module.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractBias} | tst_pmSubtractBias.c)
-
Index: unk/psModules/test/verified/tst_pmSubtractBias.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractBias.stdout	(revision 5168)
+++ 	(revision )
@@ -1,432 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractBiasFullFrame}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractBiasFullFrame} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{doSubtractFullOverscans}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{doSubtractFullOverscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Row Overscans}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Row Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Testing input parameter error conditions}   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-------------------------------------------------------------------
-Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ALL.  Should generate error.
-------------------------------------------------------------------
-Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_ROWS.  Should generate error.
-------------------------------------------------------------------
-Calling pmSubtractBias() with NULL overscan list and PM_OVERSCAN_COLUMNS.  Should generate error.
-------------------------------------------------------------------
-Calling pmSubtractBias() with non-NULL overscan list and PM_OVERSCAN_NONE.  Should generate warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() with PM_OVERSCAN_NONE and PM_FIT_POLYNOMIAL.  Should generate Warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() with PM_OVERSCAN_ALL and PM_FIT_SPLINE.  Should generate Warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() with multiple stats->options.  Should generate Warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_ROWS).  Should generate Warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() undersize overscans (PM_OVERSCAN_COLUMNS).  Should generate Warning.
-------------------------------------------------------------------
-Calling pmSubtractBias() undersize bias image (short rows).  Should generate Error.
-------------------------------------------------------------------
-Calling pmSubtractBias() undersize bias image (short columns).  Should generate Error.
-------------------------------------------------------------------
-Calling pmSubtractBias() with bogus PM_FIT.  Should generate Error.
-------------------------------------------------------------------
-Calling pmSubtractBias() with bogus overScanAxis.  Should generate Error.
-------------------------------------------------------------------
-
----> TESTPOINT PASSED (pmSubtractBias{Testing input parameter error conditions} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractBias.c                                       *
-*            TestPoint: pmSubtractBias{Column Overscans}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractBias{Column Overscans} | tst_pmSubtractBias.c)
-
Index: unk/psModules/test/verified/tst_pmSubtractSky.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractSky.stderr	(revision 5168)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: Test Point Driver{pmSubtractSky}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|W|p_psVectorSampleStdev
-    WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<HOST>|W|p_psVectorSampleStdev
-    WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<HOST>|W|ImageFitPolynomial
-    WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractSky} | tst_pmSubtractSky.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: Test Point Driver{pmSubtractSky: warning, error messages}  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<HOST>|E|pmSubtractSky (FILE:LINENO)
-    Unallowable operation: psReadout in or its data is NULL.
-<HOST>|E|pmSubtractSky (FILE:LINENO)
-    Unallowable operation: psReadout in or its data is NULL.
-<HOST>|E|pmSubtractSky (FILE:LINENO)
-    Unallowable operation: psImage in has incorrect type.
-<HOST>|W|pmSubtractSky
-    WARNING: pmSubtractSky(): input parameter stats is NULL
-<HOST>|W|pmSubtractSky
-    WARNING: pmSubtractSky(): no stats->options was requested
-<HOST>|W|pmSubtractSky
-    WARNING: Multiple statistical options have been requested.
-<HOST>|W|pmSubtractSky
-    WARNING: pmSubtractSky(): binFactor is 0
-<HOST>|W|pmSubtractSky
-    WARNING: pmSubtractSky(): binFactor is -1
-<HOST>|W|pmSubtractSky
-    WARNING: pmSubtractSky(): clipSD is -1.000000
-<HOST>|E|pmSubtractSky (FILE:LINENO)
-    psFit is unallowable (54321).  Returning in image.
-
----> TESTPOINT PASSED (Test Point Driver{pmSubtractSky: warning, error messages} | tst_pmSubtractSky.c)
-
Index: unk/psModules/test/verified/tst_pmSubtractSky.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractSky.stdout	(revision 5168)
+++ 	(revision )
@@ -1,219 +1,0 @@
-doSubtractSkySimple(1, 1, 1)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(NUM_COLS, 1, 1)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(1, NUM_ROWS, 1)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(NUM_COLS, NUM_ROWS, 1)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(1, 1, 2)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(NUM_COLS, 1, 2)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(1, NUM_ROWS, 2)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkySimple(NUM_COLS, NUM_ROWS, 2)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkySimple}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkySimple} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 1)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 2)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 4)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 8)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 16)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 32)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 64)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 128)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-doSubtractSkyWithObjects(NUM_COLS, NUM_ROWS, 256)
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{doSubtractSkyWithObjects}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (pmSubtractSky{doSubtractSkyWithObjects} | tst_pmSubtractSky.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_pmSubtractSky.c                                        *
-*            TestPoint: pmSubtractSky{Testing bad input parameter conditions.}     *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with NULL pmReadout.  Should error.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with NULL pmReadout->image.  Should error.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image.  Should error.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with NULL fitSpec.  Should return image, no ERROR, no WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with PM_FIT_NONE fit.  Should return image, no ERROR, no WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with PM_FIT_SPLINE fit.  Should return image, no ERROR, no WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with NULL myStats.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with no myStats->options specified.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with multiple myStats->options specified.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with 0 binFactor.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with -1 binFactor.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with -1.0 clipSD.  Should fit entire image, generate WARNING.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with bogus psFit.  Should generate Error.
-
-----------------------------------------------------------------
-
----> TESTPOINT PASSED (pmSubtractSky{Testing bad input parameter conditions.} | tst_pmSubtractSky.c)
-
