Index: trunk/psphot/src/pmObjects_EAM.c
===================================================================
--- trunk/psphot/src/pmObjects_EAM.c	(revision 4954)
+++ trunk/psphot/src/pmObjects_EAM.c	(revision 4977)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-07 03:33:01 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-08 04:32:40 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,4 +19,6 @@
 #include "psConstants.h"
 #include "pmObjects_EAM.h"
+#include "pmModelGroup.h"
+
 
 /******************************************************************************
@@ -653,10 +655,9 @@
 
     //
-    // Loop through the subimage mask, initialize mask to 0x01 (invalid pixel)
-    // XXX EAM : use PSPHOT_MASK_INVALID?
+    // Loop through the subimage mask & initialize PSPHOT_MASK_INVALID
     //
     for (psS32 row = 0 ; row < subImageMask->numRows; row++) {
         for (psS32 col = 0 ; col < subImageMask->numCols; col++) {
-            subImageMask->data.U8[row][col] = 0x01;
+            subImageMask->data.U8[row][col] = PSPHOT_MASK_INVALID;
         }
     }
@@ -674,5 +675,5 @@
     for (psS32 row = StartRow; row < EndRow; row++) {
         for (psS32 col = StartCol; col < EndCol; col++) {
-	    subImageMask->data.U8[row][col] = 0;
+	    subImageMask->data.U8[row][col] = PSPHOT_MASK_CLEAR;
         }
     }
@@ -1116,6 +1117,5 @@
 
 	// XXX EAM : can we use the value of SATURATE if mask is NULL?
-# define MASK_SATURATED 0x02
-	int Nsatpix = psImageCountPixelMask (tmpSrc->mask, MASK_SATURATED);
+	int Nsatpix = psImageCountPixelMask (tmpSrc->mask, PSPHOT_MASK_SATURATED);
 
         // saturated star (size consistent with PSF or larger)
@@ -1615,5 +1615,5 @@
     }       
 
-    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F64);
+    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
 
     psTrace (".pmObjects.pmSourceFitModel", 5, "fitting function\n");
@@ -1621,5 +1621,5 @@
     for (int i = 0; i < dparams->n; i++) {
 	if ((paramMask != NULL) && paramMask->data.U8[i]) continue;
-	dparams->data.F32[i] = sqrt(covar->data.F64[i][i]);
+	dparams->data.F32[i] = sqrt(covar->data.F32[i][i]);
     }
  
@@ -1640,9 +1640,9 @@
     // XXX EAM get the Gauss-Newton distance for fixed model parameters
     if (paramMask != NULL) {
-	psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64);
+	psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32);
 	psMinimizeGaussNewtonDelta (delta, params, NULL, x, y, yErr, modelFunc);
 	for (int i = 0; i < dparams->n; i++) {
 	    if (!paramMask->data.U8[i]) continue;
-	    dparams->data.F32[i] = delta->data.F64[i];
+	    dparams->data.F32[i] = delta->data.F32[i];
 	}
 	psFree (delta);
