Index: /trunk/psphot/src/pmObjects_EAM.c
===================================================================
--- /trunk/psphot/src/pmObjects_EAM.c	(revision 5350)
+++ /trunk/psphot/src/pmObjects_EAM.c	(revision 5351)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-17 18:07:54 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-10-17 19:04:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -999,5 +999,5 @@
     int Ncr    	 = 0;
     int Nsatstar = 0;
-    psRegion allArray = {0, 0, 0, 0};
+    // psRegion allArray;
 
     psVector *starsn = psVectorAlloc (sources->n, PS_TYPE_F32);
@@ -1031,5 +1031,8 @@
 
 	// XXX EAM : can we use the value of SATURATE if mask is NULL?
-	int Nsatpix = psImageCountPixelMask (tmpSrc->mask, allArray, PSPHOT_MASK_SATURATED);
+	// XXX EAM *** serious errors in psImageCountPixelMask: inconsistent with psRegion and subimage
+	// allArray = psRegionSet (1, tmpSrc->mask->numCols, 1, tmpSrc->mask->numRows);
+	// int Nsatpix = psImageCountPixelMask (tmpSrc->mask, allArray, PSPHOT_MASK_SATURATED);
+	int Nsatpix = psImageCountPixelMask_EAM (tmpSrc->mask, PSPHOT_MASK_SATURATED);
 
         // saturated star (size consistent with PSF or larger)
Index: /trunk/psphot/src/psLibUtils.c
===================================================================
--- /trunk/psphot/src/psLibUtils.c	(revision 5350)
+++ /trunk/psphot/src/psLibUtils.c	(revision 5351)
@@ -280,8 +280,8 @@
 }	    
 
-# if (0)
 // now in psLib (v8)
 // count number of pixels with given mask value
-int psImageCountPixelMask (psImage *mask, psU8 value) 
+// XXX EAM : version in psLib is broken
+int psImageCountPixelMask_EAM (psImage *mask, psU8 value) 
 {
     int Npixels = 0;
@@ -296,5 +296,4 @@
     return (Npixels);
 }
-# endif
 
 // define a square region centered on the given coordinate
Index: /trunk/psphot/src/psLibUtils.h
===================================================================
--- /trunk/psphot/src/psLibUtils.h	(revision 5350)
+++ /trunk/psphot/src/psLibUtils.h	(revision 5351)
@@ -29,4 +29,6 @@
 psF64        p_psMinLM_dLinear (const psVector *Beta, const psVector *beta, psF64 lambda);
 
+int          psImageCountPixelMask_EAM (psImage *mask, psU8 value); // added to SDRS
+
 // psLib extra utilities
 # if (0) // added to psLib v8
@@ -34,5 +36,4 @@
 int	     psArgumentRemove (int N, int *argc, char **argv); // added to SDRS
 bool 	     psTimerClear (char *name);   // added to SDRS 
-int          psImageCountPixelMask (psImage *mask, psU8 value); // added to SDRS
 psVector    *psVectorCreate (double lower, double upper, double delta, psElemType type); // added to SDRS
 # endif
