Index: /trunk/psModules/src/pmSubtractSky.c
===================================================================
--- /trunk/psModules/src/pmSubtractSky.c	(revision 2587)
+++ /trunk/psModules/src/pmSubtractSky.c	(revision 2588)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-01 21:39:30 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-01 21:46:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,9 +17,10 @@
 #include "psConstants.h"
 
+// XXX: this is pmFit in pmSubtractBias.c, and psFit here.
 typedef enum {
     PM_FIT_NONE,                              ///< No fit
     PM_FIT_POLYNOMIAL,                        ///< Fit polynomial
     PM_FIT_SPLINE                             ///< Fit cubic splines
-} pmFit;
+} psFit;
 
 int p_psDetermineNumBits(unsigned int data)
@@ -91,5 +92,5 @@
                 for (int binCol = 0; binCol <= binFactor ; binCol++) {
                     if (((row + binRow) < origImage->numRows) &&
-                            ((col + binCol) < origImage->numCol)) {
+                            ((col + binCol) < origImage->numCols)) {
                         binVector->data.F32[count] =
                             origImage->data.F32[row + binRow][col + binCol];
@@ -144,6 +145,7 @@
 
     psImage *origImage = in->image;
+    psImage *maskImage = in->mask;
     psImage *binnedImage = NULL;
-    psPolynomial1D *myPoly;
+    psPolynomial2D *myPoly;
     psSpline1D *mySpline;
 
@@ -179,9 +181,9 @@
         psF64 binnedStdev;
         psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
-        myStats =  psImageStats(myStats, binedImage, NULL, 0);
+        myStats =  psImageStats(myStats, binnedImage, NULL, 0);
         p_psGetStatValue(myStats, &binnedMean);
 
         myStats->options = PS_STAT_SAMPLE_STDEV;
-        myStats =  psImageStats(myStats, binedImage, NULL, 0);
+        myStats =  psImageStats(myStats, binnedImage, NULL, 0);
         p_psGetStatValue(myStats, &binnedStdev);
         psFree(myStats);
@@ -191,5 +193,5 @@
                 if (fabs(binnedImage->data.F32[row][col] - binnedMean) >
                         (clipSD * binnedStdev)) {
-                    binnedImage->mask.U8[row][col] = 1;
+                    maskImage->data.U8[row][col] = 1;
                 }
             }
@@ -200,6 +202,5 @@
     if (fit == PM_FIT_POLYNOMIAL) {
         // Fit a polynomial to the old overscan vector.
-        myPoly = (psPolynomial2D *)
-                 fitSpec;
+        myPoly = (psPolynomial2D *) fitSpec;
         myPoly = psImageFitPolynomial(myPoly, origImage);
         // XXX Do we need to do something with ordinate scaling if Chebyshev?
@@ -208,6 +209,5 @@
     } else if (fit == PM_FIT_SPLINE) {
         // Fit a spline to the old overscan vector.
-        mySpline = (psSpline1D *)
-                   fitSpec;
+        mySpline = (psSpline1D *) fitSpec;
         // XXX: What do we do?  We don't have 2-D splines.
         return(in);
