Index: trunk/psModules/src/pmSubtractSky.c
===================================================================
--- trunk/psModules/src/pmSubtractSky.c	(revision 2586)
+++ trunk/psModules/src/pmSubtractSky.c	(revision 2587)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-01 21:27:26 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-01 21:39:30 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,4 +16,10 @@
 #include "pslib.h"
 #include "psConstants.h"
+
+typedef enum {
+    PM_FIT_NONE,                              ///< No fit
+    PM_FIT_POLYNOMIAL,                        ///< Fit polynomial
+    PM_FIT_SPLINE                             ///< Fit cubic splines
+} pmFit;
 
 int p_psDetermineNumBits(unsigned int data)
@@ -50,5 +56,5 @@
         return(PS_STAT_ROBUST_MODE);
     }
-    psError(XXX);
+    //    psError(XXX);
     return(-1);
 }
@@ -68,46 +74,46 @@
     psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32);
     psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8);
-    psStats *myStats = psStatsAlloc(statOptions)
-
-                       if (binFactor <= 0) {
-                           psLogMsg(__func__, PS_LOG_WARN,
-                                    "WARNING: binImage(): binFactor is %d\n", binFactor);
-                           return(origImage);
-                       }
-                       if (binFactor == 1) {
-                           return(origImage);
-                       }
-
-                       for (int row = 0; row < origImage->numRows ; row+=binFactor) {
-                           for (int col = 0; col < origImage->numCols ; col+=binFactor) {
-                               int count = 0;
-                               for (int binRow = 0; binRow <= binFactor ; binRow++) {
-                                   for (int binCol = 0; binCol <= binFactor ; binCol++) {
-                                       if (((row + binRow) < origImage->numRows) &&
-                                               ((col + binCol) < origImage->numCol)) {
-                                           binVector->data.F32[count] =
-                                               origImage->data.F32[row + binRow][col + binCol];
-                                           binMask->data.U8[count] = 0;
-                                       } else {
-                                           binVector->data.F32[count] = 0.0;
-                                           binMask->data.U8[count] = 1;
-                                       }
-                                       count++;
-                                   }
-                               }
-                               myStats = psVectorStats(myStats, binVector, binMask, 1);
-                               psF64 statValue;
-                               psBool rc = p_psGetStatValue(myStats, &statValue);
-
-                               if (rc == true) {
-                                   origImage->data.F32[row][col] = (psF32) statValue;
-                               } else {
-                                   origImage->data.F32[row][col] = 0.0;
-                                   psLogMsg(__func__, PS_LOG_WARN,
-                                            "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n");
-                               }
-                           }
-                       }
-                       psFree(myStats);
+    psStats *myStats = psStatsAlloc(statOptions);
+
+    if (binFactor <= 0) {
+        psLogMsg(__func__, PS_LOG_WARN,
+                 "WARNING: binImage(): binFactor is %d\n", binFactor);
+        return(origImage);
+    }
+    if (binFactor == 1) {
+        return(origImage);
+    }
+
+    for (int row = 0; row < origImage->numRows ; row+=binFactor) {
+        for (int col = 0; col < origImage->numCols ; col+=binFactor) {
+            int count = 0;
+            for (int binRow = 0; binRow <= binFactor ; binRow++) {
+                for (int binCol = 0; binCol <= binFactor ; binCol++) {
+                    if (((row + binRow) < origImage->numRows) &&
+                            ((col + binCol) < origImage->numCol)) {
+                        binVector->data.F32[count] =
+                            origImage->data.F32[row + binRow][col + binCol];
+                        binMask->data.U8[count] = 0;
+                    } else {
+                        binVector->data.F32[count] = 0.0;
+                        binMask->data.U8[count] = 1;
+                    }
+                    count++;
+                }
+            }
+            myStats = psVectorStats(myStats, binVector, binMask, 1);
+            psF64 statValue;
+            psBool rc = p_psGetStatValue(myStats, &statValue);
+
+            if (rc == true) {
+                origImage->data.F32[row][col] = (psF32) statValue;
+            } else {
+                origImage->data.F32[row][col] = 0.0;
+                psLogMsg(__func__, PS_LOG_WARN,
+                         "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n");
+            }
+        }
+    }
+    psFree(myStats);
     psFree(binVector);
     psFree(binMask);
