Index: /branches/eam_rel8_b1/psModules/src/objects/pmObjects.c
===================================================================
--- /branches/eam_rel8_b1/psModules/src/objects/pmObjects.c	(revision 5602)
+++ /branches/eam_rel8_b1/psModules/src/objects/pmObjects.c	(revision 5603)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-10 19:53:40 $
+ *  @version $Revision: 1.2.6.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-26 02:48:02 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -769,6 +769,7 @@
     for (psS32 row = 0; row < source->pixels->numRows ; row++) {
         for (psS32 col = 0; col < source->pixels->numCols ; col++) {
-            if ((source->mask != NULL) && (source->mask->data.U8[row][col]))
+            if ((source->mask != NULL) && (source->mask->data.U8[row][col])) {
                 continue;
+            }
 
             psF32 xDiff = col + source->pixels->col0 - xPeak;
@@ -777,6 +778,7 @@
             // XXX EAM : calculate xDiff, yDiff up front;
             //           radius is just a function of (xDiff, yDiff)
-            if (!VALID_RADIUS(xDiff, yDiff, R2))
+            if (!VALID_RADIUS(xDiff, yDiff, R2)) {
                 continue;
+            }
 
             psF32 pDiff = source->pixels->data.F32[row][col] - sky;
@@ -784,6 +786,7 @@
             // XXX EAM : check for valid S/N in pixel
             // XXX EAM : should this limit be user-defined?
-            if (pDiff / sqrt(source->weight->data.F32[row][col]) < 1)
+            if (pDiff / sqrt(source->weight->data.F32[row][col]) < 1) {
                 continue;
+            }
 
             Sum += pDiff;
@@ -1065,4 +1068,5 @@
     int Ncr      = 0;
     int Nsatstar = 0;
+    psRegion allArray = psRegionSet (0, 0, 0, 0);
 
     psVector *starsn = psVectorAlloc (sources->n, PS_TYPE_F32);
@@ -1096,10 +1100,5 @@
 
         // XXX EAM : can we use the value of SATURATE if mask is NULL?
-        //
-        // XXX: Must verify this region (the region argument was added to psImageCountPixelMask()
-        // after EAM wrote this code.
-        //
-        psRegion tmpRegion = psRegionSet(0, tmpSrc->mask->numCols, 0, tmpSrc->mask->numRows);
-        int Nsatpix = psImageCountPixelMask(tmpSrc->mask, tmpRegion, PSPHOT_MASK_SATURATED);
+        int Nsatpix = psImageCountPixelMask (tmpSrc->mask, allArray, PSPHOT_MASK_SATURATED);
 
         // saturated star (size consistent with PSF or larger)
@@ -1759,8 +1758,8 @@
                 ymodel = modelFunc (NULL, model->params, coord);
 
-                // this test enhances the weight based on deviation from the model flux
+                // this test modifies the weight based on deviation from the model flux
                 Ro = 1.0 + fabs (y->data.F32[tmpCnt] - ymodel) / sqrt(PS_SQR(ymodel - So) + PS_SQR(So));
 
-                // psMinimizeLMChi2_EAM takes wt = 1/dY^2
+                // psMinimizeLMChi2 takes wt = 1/dY^2
                 if (source->weight->data.F32[i][j] == 0) {
                     yErr->data.F32[tmpCnt] = 0.0;
