Index: trunk/psLib/test/image/tst_psImageConvolve.c
===================================================================
--- trunk/psLib/test/image/tst_psImageConvolve.c	(revision 3682)
+++ trunk/psLib/test/image/tst_psImageConvolve.c	(revision 3702)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-07 20:27:42 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-04-15 00:12:09 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -22,10 +22,10 @@
 static psS32 testKernelAlloc(void);
 static psS32 testKernelGenerate(void);
-//static psS32 testImageConvolve(void);
+static psS32 testImageConvolve(void);
 
 testDescription tests[] = {
                               {testKernelAlloc,731,"psKernelAlloc",0,false},
                               {testKernelGenerate,732,"psKernelGenerate",0,false},
-                              //                              {testImageConvolve,733,"psImageConvolve",0,false},
+                              {testImageConvolve,733,"psImageConvolve",0,false},
                               {NULL}
                           };
@@ -286,5 +286,4 @@
 }
 
-/*
 static psS32 testImageConvolve(void)
 {
@@ -292,5 +291,5 @@
     const psS32 c = 300;
     psS32 sum;
- 
+
     // approximate a normalized gaussian kernel.
     psKernel* g = psKernelAlloc(-1,1,-1,1);
@@ -304,5 +303,5 @@
                 g->kernel[0][1] = 0.0838;
     g->kernel[0][0] = 0.6193;
- 
+
     // create a normalized non-symetric kernel.
     psKernel* nsk = psKernelAlloc(0,2,0,2);
@@ -319,6 +318,6 @@
         }
     }
- 
- 
+
+
     psImage* img = psImageAlloc(c,r,PS_TYPE_F32);
     memset(img->data.F32[0],0,c*r*PSELEMTYPE_SIZEOF(PS_TYPE_F32));
@@ -326,14 +325,14 @@
     img->data.F32[r/2][c/2] = 1.0f;
     img->data.F32[r-1][c/2] = 1.0f;
- 
+
     // test spacial convolution of gaussian
     psLogMsg(__func__,PS_LOG_INFO,"Testing direct gaussian convolution");
     psImage* out = psImageConvolve(NULL, img, g, true);
- 
+
     if (out == NULL) {
         psError(PS_ERR_UNKNOWN, true, "psImageConvolve returned a NULL for direct gaussian case.");
         return 1;
     }
- 
+
     if (out->numCols != c || out->numRows != r) {
         psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is %dx%d, but expected %dx%d.",
@@ -342,5 +341,5 @@
         return 2;
     }
- 
+
     if (out->type.type != PS_TYPE_F32) {
         char* typeStr;
@@ -350,5 +349,5 @@
         return 3;
     }
- 
+
     // test values
     for (psS32 i=-1;i<1;i++) {
@@ -374,32 +373,19 @@
         }
     }
- 
+
     // test fourier convolution of gaussian
     psLogMsg(__func__,PS_LOG_INFO,"Testing fourier gaussian convolution");
-    psKernel* gg = psKernelAlloc(1,3,1,3);
-    gg->kernel[1][1] =
-        gg->kernel[1][3] =
-            gg->kernel[3][1] =
-                gg->kernel[3][3] = 0.0113;
-    gg->kernel[3][2] =
-        gg->kernel[1][2] =
-            gg->kernel[2][1] =
-                gg->kernel[2][3] = 0.0838;
-    gg->kernel[2][2] = 0.6193;
-    img->data.F32[0][0] = 0.0f;
-    img->data.F32[r/2][c/2] = 1.0f;
-    img->data.F32[r-1][c/2] = 0.0f;
-    psImage* out2 = psImageConvolve(out, img, gg, false);
- 
+    psImage* out2 = psImageConvolve(out, img, g, false);
+
     if (out == NULL) {
         psError(PS_ERR_UNKNOWN, true, "psImageConvolve returned a NULL for gaussian case.");
         return 10;
     }
- 
+
     if (out != out2) {
         psError(PS_ERR_UNKNOWN, true, "psImageConvolve didn't recycle the supplied out image struct.");
         return 11;
     }
- 
+
     if (out->numCols != c || out->numRows != r) {
         psError(PS_ERR_UNKNOWN, true, "psImageConvolve result image is %dx%d, but expected %dx%d.",
@@ -408,5 +394,5 @@
         return 12;
     }
- 
+
     if (out->type.type != PS_TYPE_F32) {
         char* typeStr;
@@ -416,17 +402,15 @@
         return 13;
     }
- 
-    psImageWriteSection(out2,0,0,0,NULL,0,"out2.fits");
+
     // test values
     for (psS32 i=-1;i<1;i++) {
         for (psS32 j=-1;j<1;j++) {
-            if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.0001) {
+            if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.01) {
                 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d.  Value is %g, expected %g.",
                         c/2+j,r/2+i,
                         out->data.F32[r/2+i][c/2+j], g->kernel[i][j]);
-                psImageWriteSection(out,0,0,0,NULL,0,"problem.fits");
                 return 14;
             }
-            if (i >= 0 && j >= 0 && fabsf(out->data.F32[i][j] - g->kernel[i][j]) > 0.0001) {
+            if (i >= 0 && j >= 0 && fabsf(out->data.F32[i][j] - g->kernel[i][j]) > 0.01) {
                 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d.  Value is %g, expected %g.",
                         j,i,
@@ -434,5 +418,5 @@
                 return 15;
             }
-            if (i <= 0 && fabsf(out->data.F32[r-1+i][c/2+j] - g->kernel[i][j]) > 0.0001) {
+            if (i <= 0 && fabsf(out->data.F32[r-1+i][c/2+j] - g->kernel[i][j]) > 0.01) {
                 psError(PS_ERR_UNKNOWN, true,"Convolved image wrong at %d,%d.  Value is %g, expected %g.",
                         c/2+j,r-1+i,
@@ -442,5 +426,5 @@
         }
     }
- 
+
     psFree(g);
     psFree(img);
@@ -449,4 +433,3 @@
     return 0;
 }
-*/
-
+
