Index: /trunk/psModules/src/pmNonLinear.c
===================================================================
--- /trunk/psModules/src/pmNonLinear.c	(revision 2129)
+++ /trunk/psModules/src/pmNonLinear.c	(revision 2130)
@@ -5,6 +5,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-14 19:01:37 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-14 21:44:08 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,4 +21,11 @@
 #include "pmNonLinear.h"
 
+/******************************************************************************
+pmNonLinearityLookup(): This routine will take an psReadout image as input
+and a 1-D polynomial.  For each pixel in the input image, the polynomial will
+be evaluated at that pixels value, and the image pixel will then be set to
+that value.
+ *****************************************************************************/
+
 psReadout *pmNonLinearityPolynomial(psReadout *in,
                                     const psPolynomial1D *coeff)
@@ -32,5 +39,5 @@
 
     for (i=0;i<(in->image)->numRows;i++) {
-        for (j=0;j<(in->image)->numRows;j++) {
+        for (j=0;j<(in->image)->numCols;j++) {
             (in->image)->data.F32[i][j] = psPolynomial1DEval((in->image)->data.F32[i][j], coeff);
         }
@@ -40,4 +47,11 @@
 
 
+/******************************************************************************
+pmNonLinearityLookup(): This routine will take an psReadout image as input
+and two input vectors, which constitute a lookup table.  For each pixel in
+the input image, that pixels value will be determined in the input vector
+inFluxe, and the corresponding value in outFlux.  The image pixel will then
+be set to the value from outFlux.
+ *****************************************************************************/
 psReadout *pmNonLinearityLookup(psReadout *in,
                                 const psVector *inFlux,
@@ -57,4 +71,5 @@
     float slope;
 
+    x.type.type = PS_TYPE_F32;
     if (inFlux->n != outFlux->n) {
         // XXX: psWarning("pmNonLinearityLookup(): input vectors have different size");
@@ -65,8 +80,8 @@
         return(in);
     }
-
     for (i=0;i<(in->image)->numRows;i++) {
         for (j=0;j<(in->image)->numCols;j++) {
             x.data.F32 = (in->image)->data.F32[i][j];
+
             binNum = p_psVectorBinDisect((psVector *)inFlux, &x);
 
