Index: trunk/psModules/test/detrend/tst_pmFlatField.c
===================================================================
--- trunk/psModules/test/detrend/tst_pmFlatField.c	(revision 5435)
+++ trunk/psModules/test/detrend/tst_pmFlatField.c	(revision 5516)
@@ -21,6 +21,8 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-20 23:06:24 $
+ *  XXX: I added the CELL.TRIMSEC region code but there are not tests for it.
+ *
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-15 20:09:03 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: trunk/psModules/test/detrend/tst_pmMaskBadPixels.c
===================================================================
--- trunk/psModules/test/detrend/tst_pmMaskBadPixels.c	(revision 5435)
+++ trunk/psModules/test/detrend/tst_pmMaskBadPixels.c	(revision 5516)
@@ -17,6 +17,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-28 20:42:52 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-15 20:09:03 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,12 +32,12 @@
 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]);                                                       \
+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("%f", (double)(IMAGE)->data.TYPE[i][j]);                                                    \
         }                                                                                                    \
     }                                                                                                        \
@@ -48,11 +48,10 @@
 
 #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;                                                                       \
+(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);
@@ -80,8 +79,13 @@
                               {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},
+                              {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false        },
                               {NULL}
                           };
 
+/*
+    #define PS_TYPE_MASK PS_TYPE_U8
+    #define PS_TYPE_MASK_DATA U8
+    #define PS_TYPE_MASK_NAME "psU8"
+*/
 
 int main(int argc, char* argv[])
@@ -92,39 +96,66 @@
 
 
+#define NUM_ROWS 50
+#define NUM_COLS 50
+#define DEFAULT_IMAGE_VAL 0.0
+#define DEFAULT_MASK_VAL 0
+#define MASK_VAL 1
+#define SAT_VAL  100.0
+#define GROW_VAL 1
+#define GROW_RAD 10
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+    maskReadout->image->data.PS_TYPE_MASK_DATA[NUM_ROWS/2][NUM_COLS/2]=1;
+    maskReadout->image->row0 = 0;
+    maskReadout->image->col0 = 0;
+
+    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+    PRINT_MATRIX(inReadout->mask, PS_TYPE_MASK_DATA, "Resulting mask:");
+
+    psFree(inReadout);
+    psFree(maskReadout);
+
+    return 0;
+}
+
+int testMaskBadPixels2( void )
+{
+    //
+    // Test B - Create mask based on saturation argument
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+    inReadout->image->data.F32[NUM_ROWS/2][NUM_COLS/2] = 150.0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+
+    //PS_IMAGE_PRINT_F32(inReadout->image);
+    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     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);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -133,20 +164,28 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+    inReadout->image->data.F32[NUM_ROWS/2][NUM_COLS/2]=GROW_VAL;
+    inReadout->image->data.F32[NUM_ROWS/4][NUM_COLS/4]=GROW_VAL;
+    inReadout->image->data.F32[NUM_ROWS/4][NUM_COLS-(NUM_COLS/4)]=GROW_VAL;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS);
+
+    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
+    //PS_IMAGE_PRINT_F32(inReadout->image);
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -155,20 +194,25 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+    maskReadout->image->data.PS_TYPE_MASK_DATA[NUM_ROWS/2][NUM_COLS/2]=1;
+
+    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -177,13 +221,17 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmMaskBadPixels(inReadout, NULL, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+    psFree(inReadout);
 
     return 0;
@@ -192,13 +240,19 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -207,17 +261,22 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS+10, NUM_COLS+10);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -226,17 +285,22 @@
 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);
+    //
+    // Test H - Attempt to use mask bigger than image
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS+10, NUM_COLS+10)
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -245,19 +309,23 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+    *(int*)&inReadout->image->col0 = 150;
+    *(int*)&inReadout->image->row0 = 150;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -266,17 +334,22 @@
 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);
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, C64, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
 
     return 0;
@@ -285,19 +358,24 @@
 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;
-}
-
+    //
+    // Test K - Attempt to use mask image with wrong data type.
+    //
+
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
+    inReadout->image->row0 = 0;
+    inReadout->image->col0 = 0;
+    inReadout->row0 = 0;
+    inReadout->col0 = 0;
+
+    pmReadout *maskReadout = pmReadoutAlloc(NULL);
+    CREATE_AND_SET_IMAGE(maskReadout->image, F64, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
+
+    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
+
+    psFree(inReadout);
+    psFree(maskReadout);
+
+    return 0;
+}
+
