Index: /trunk/psModules/src/pmSubtractBias.c
===================================================================
--- /trunk/psModules/src/pmSubtractBias.c	(revision 1876)
+++ /trunk/psModules/src/pmSubtractBias.c	(revision 1877)
@@ -8,6 +8,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-24 00:23:48 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 18:31:02 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -118,88 +118,88 @@
         psImageStats(stat, in->image, in->mask, 0xffffffff);
         p_psImageSubtractScalar(in->image, stat->value);
-        return(in)
-          }
-
-          if (((overScanAxis == PM_OVERSCAN_NONE) ||
-                  (overScanAxis == PM_OVERSCAN_ALL)) &&
-                  (fit == PM_FIT_NONE)) {
-              //XXX: psWarningMsg()
-              //XXX: Then what?
-              return(in)
-                }
-
-                // XXX: Is there a better way to extract a psVector from a psImage without
-                // having to copy every element in that vector?
-
-                // XXX: If we get here, do we know that overScanAxis == PM_OVERSCAN_ROW
-                // or PM_OVERSCAN_COL?
-
-                if ((overScanAxis == PM_OVERSCAN_ROW) || (overScanAxis == PM_OVERSCAN_COL)) {
-                    if (overScanAxis == PM_OVERSCAN_ROW) {
-                        tmp = psVectorAlloc((in->image)->numCols, PS_TYPE_F32);
-                        tmpRow = psVectorAlloc((in->image)->numCols, PS_TYPE_F32);
-                        tmpMask = psVectorAlloc((in->image)->numCols, PS_TYPE_U8);
-                        for (i=0;i<(in->image)->numCols;i++) {
-                            for (j=0;j<(in->image)->numRows;j++) {
-                                tmpRow->data.F32[j] = (in->image)->data.F32[i][j];
-                                tmpMask->data.U8[j] = (in->mask)->data.U8[i][j];
-                            }
-                            stat = psVectorStats(stat, tmpRow, tmpMask, 0xffffffff);
-                            tmp->data.F32[i] = stat->value;
-                        }
-                    }
-                    if (overScanAxis == PM_OVERSCAN_COL) {
-                        tmp = psVectorAlloc((in->image)->numRows, PS_TYPE_F32);
-                        tmpcol = psVectorAlloc((in->image)->numRows, PS_TYPE_F32);
-                        tmpMask = psVectorAlloc((in->image)->nuRows, PS_TYPE_U8);
-                        for (i=0;i<(in->image)->numRows;i++) {
-                            for (j=0;j<(in->image)->numCols;j++) {
-                                tmpRow->data.F32[j] = (in->image)->data.F32[i][j];
-                                tmpMask->data.U8[j] = (in->mask)->data.U8[i][j];
-                            }
-                            stat = psVectorStats(stat, tmpRow, tmpMask, 0xffffffff);
-                            tmp->data.F32[i] = stat->value;
-                        }
-                    }
-
-                    if (nBin > 0) {
-                        numBins = 1+((tmp->n)/nBin);
-                        psVector *myBin = psVectorAlloc(numBins, PS_TYPE_F32);
-
-                        for (i=0;i<numBins;i++) {
-                            // XXX: do this
-                        }
-                        // XXX: resize tmp to myBin, and store myBin elements there.
-                    } else {
-                        nBin = 1;
-                    }
-
-                    if (!((fitSpec == NULL) || (fit ==PM_FIT_NONE))) {
-                        fit the vector to a linear or cubic spline.
-                    }
-
-                    if (overScanAxis == PM_OVERSCAN_ROW) {
-                        for (i=0;i<(in->image)->numCols;i++) {
-                            for (j=0;j<(in->image)->numRows;j++) {
-                                (in->image)->data.F32[i][j]-= tmp->data.F32[j/nBin];
-                            }
-                        }
-                    }
-
-                    if (overScanAxis == PM_OVERSCAN_COLUMN) {
-                        for (i=0;i<(in->image)->numRows;i++) {
-                            for (j=0;j<(in->image)->numCols;j++) {
-                                (in->image)->data.F32[i][j]-= tmp->data.F32[j/nBin];
-                            }
-                        }
-                    }
-                    return(in);
-                }
-
-                if (bias != NULL) {
-                    return(psSubtractFrame(in, bias));
-                }
-
-                // XXX: psErrorMsg(): Shouldn't get here?
-            }
-
+        return(in);
+    }
+
+    if (((overScanAxis == PM_OVERSCAN_NONE) ||
+            (overScanAxis == PM_OVERSCAN_ALL)) &&
+            (fit == PM_FIT_NONE)) {
+        //XXX: psWarningMsg()
+        //XXX: Then what?
+        return(in);
+    }
+
+    // XXX: Is there a better way to extract a psVector from a psImage without
+    // having to copy every element in that vector?
+
+    // XXX: If we get here, do we know that overScanAxis == PM_OVERSCAN_ROW
+    // or PM_OVERSCAN_COL?
+
+    if ((overScanAxis == PM_OVERSCAN_ROW) || (overScanAxis == PM_OVERSCAN_COL)) {
+        if (overScanAxis == PM_OVERSCAN_ROW) {
+            tmp = psVectorAlloc((in->image)->numCols, PS_TYPE_F32);
+            tmpRow = psVectorAlloc((in->image)->numCols, PS_TYPE_F32);
+            tmpMask = psVectorAlloc((in->image)->numCols, PS_TYPE_U8);
+            for (i=0;i<(in->image)->numCols;i++) {
+                for (j=0;j<(in->image)->numRows;j++) {
+                    tmpRow->data.F32[j] = (in->image)->data.F32[i][j];
+                    tmpMask->data.U8[j] = (in->mask)->data.U8[i][j];
+                }
+                stat = psVectorStats(stat, tmpRow, tmpMask, 0xffffffff);
+                tmp->data.F32[i] = stat->value;
+            }
+        }
+        if (overScanAxis == PM_OVERSCAN_COL) {
+            tmp = psVectorAlloc((in->image)->numRows, PS_TYPE_F32);
+            tmpcol = psVectorAlloc((in->image)->numRows, PS_TYPE_F32);
+            tmpMask = psVectorAlloc((in->image)->nuRows, PS_TYPE_U8);
+            for (i=0;i<(in->image)->numRows;i++) {
+                for (j=0;j<(in->image)->numCols;j++) {
+                    tmpRow->data.F32[j] = (in->image)->data.F32[i][j];
+                    tmpMask->data.U8[j] = (in->mask)->data.U8[i][j];
+                }
+                stat = psVectorStats(stat, tmpRow, tmpMask, 0xffffffff);
+                tmp->data.F32[i] = stat->value;
+            }
+        }
+
+        if (nBin > 0) {
+            numBins = 1+((tmp->n)/nBin);
+            psVector *myBin = psVectorAlloc(numBins, PS_TYPE_F32);
+
+            for (i=0;i<numBins;i++) {
+                // XXX: do this
+            }
+            // XXX: resize tmp to myBin, and store myBin elements there.
+        } else {
+            nBin = 1;
+        }
+
+        if (!((fitSpec == NULL) || (fit ==PM_FIT_NONE))) {
+            fit the vector to a linear or cubic spline.
+        }
+
+        if (overScanAxis == PM_OVERSCAN_ROW) {
+            for (i=0;i<(in->image)->numCols;i++) {
+                for (j=0;j<(in->image)->numRows;j++) {
+                    (in->image)->data.F32[i][j]-= tmp->data.F32[j/nBin];
+                }
+            }
+        }
+
+        if (overScanAxis == PM_OVERSCAN_COLUMN) {
+            for (i=0;i<(in->image)->numRows;i++) {
+                for (j=0;j<(in->image)->numCols;j++) {
+                    (in->image)->data.F32[i][j]-= tmp->data.F32[j/nBin];
+                }
+            }
+        }
+        return(in);
+    }
+
+    if (bias != NULL) {
+        return(psSubtractFrame(in, bias));
+    }
+
+    // XXX: psErrorMsg(): Shouldn't get here?
+}
+
