Index: trunk/psModules/src/objects/pmModel.h
===================================================================
--- trunk/psModules/src/objects/pmModel.h	(revision 8880)
+++ trunk/psModules/src/objects/pmModel.h	(revision 8882)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,4 +49,18 @@
 }
 pmModel;
+
+/** Symbolic names for the elements of [d]params
+ * Note: these are #defines not enums as a given element of [d]params
+ * may/will correspond to different parameters in different contexts
+ */
+#define PM_PAR_SKY 0   // Sky
+#define PM_PAR_FLUX 1   // Flux
+#define PM_PAR_XPOS 2   // X centre of object
+#define PM_PAR_YPOS 3   // Y centre of object
+#define PM_PAR_SXX 4   // shape X^2 moment
+#define PM_PAR_SYY 5   // shape Y^2 moment
+#define PM_PAR_SXY 6   // shape XY moment
+#define PM_PAR_7 7   // ??? Unknown parameter
+#define PM_PAR_8 8   // ??? Unknown parameter
 
 /** pmModelAlloc()
Index: trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- trunk/psModules/src/objects/pmPSFtry.c	(revision 8880)
+++ trunk/psModules/src/objects/pmPSFtry.c	(revision 8882)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -191,5 +191,5 @@
     psTrace ("psphot.psftry", 3, "keeping %d of %ld PSF candidates (PSF)\n", Npsf, sources->n);
 
-    // measure the chi-square trend as a function of flux (PAR[1])
+    // measure the chi-square trend as a function of flux (PAR[PM_PAR_FLUX])
     // this should be linear for Poisson errors and quadratic for constant sky errors
     psVector *flux  = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
@@ -206,5 +206,5 @@
             mask->data.U8[i] = 1;
         } else {
-            flux->data.F64[i] = model->params->data.F32[1];
+            flux->data.F64[i] = model->params->data.F32[PM_PAR_FLUX];
             chisq->data.F64[i] = model[0].chisq/model[0].nDOF;
             mask->data.U8[i] = 0;
Index: trunk/psModules/src/objects/pmSourceIO_CMP.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_CMP.c	(revision 8880)
+++ trunk/psModules/src/objects/pmSourceIO_CMP.c	(revision 8882)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -116,14 +116,14 @@
 
         type = pmSourceDophotType (source);
-        lsky = (PAR[0] < 1.0) ? 0.0 : log10(PAR[0]);
-
-        shape.sx  = PAR[4];
-        shape.sy  = PAR[5];
-        shape.sxy = PAR[6];
+        lsky = (PAR[PM_PAR_SKY] < 1.0) ? 0.0 : log10(PAR[PM_PAR_SKY]);
+
+        shape.sx  = PAR[PM_PAR_SXX];
+        shape.sy  = PAR[PM_PAR_SYY];
+        shape.sxy = PAR[PM_PAR_SXY];
         axes = psEllipseShapeToAxes (shape);
 
         psLineInit (line);
-        psLineAdd (line, "%6.1f ",  PAR[2]);
-        psLineAdd (line, "%6.1f ",  PAR[3]);
+        psLineAdd (line, "%6.1f ",  PAR[PM_PAR_XPOS]);
+        psLineAdd (line, "%6.1f ",  PAR[PM_PAR_YPOS]);
         psLineAdd (line, "%6.3f ",  PS_MIN (99.0, source->psfMag + ZERO_POINT));
         psLineAdd (line, "%03d ",   PS_MIN (999, (int)(1000*source->errMag)));
@@ -253,7 +253,7 @@
             dPAR = model->dparams->data.F32;
 
-            PAR[0]         = pow (atof (array->data[5]), 10.0);
-            PAR[2]         = atof (array->data[0]);
-            PAR[3]         = atof (array->data[1]);
+            PAR[PM_PAR_SKY] = pow (atof (array->data[5]), 10.0);
+            PAR[PM_PAR_XPOS] = atof (array->data[0]);
+            PAR[PM_PAR_YPOS] = atof (array->data[1]);
             source->psfMag = atof (array->data[2]);
             source->extMag = atof (array->data[6]);
Index: trunk/psModules/src/objects/pmSourceIO_OBJ.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_OBJ.c	(revision 8880)
+++ trunk/psModules/src/objects/pmSourceIO_OBJ.c	(revision 8882)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -62,5 +62,5 @@
         dPAR = model->dparams->data.F32;
 
-        dmag = dPAR[1] / PAR[1];
+        dmag = dPAR[PM_PAR_FLUX] / PAR[PM_PAR_FLUX];
         type = pmSourceDophotType (source);
         if ((source->apMag < 99.0) && (source->psfMag < 99.0)) {
@@ -70,16 +70,16 @@
         }
 
-        shape.sx  = PAR[4];
-        shape.sy  = PAR[5];
-        shape.sxy = PAR[6];
+        shape.sx  = PAR[PM_PAR_SXX];
+        shape.sy  = PAR[PM_PAR_SYY];
+        shape.sxy = PAR[PM_PAR_SXY];
         axes = psEllipseShapeToAxes (shape);
 
         psLineInit (line);
         psLineAdd (line, "%3d",   type);
-        psLineAdd (line, "%8.2f", PAR[2]);
-        psLineAdd (line, "%8.2f", PAR[3]);
+        psLineAdd (line, "%8.2f", PAR[PM_PAR_XPOS]);
+        psLineAdd (line, "%8.2f", PAR[PM_PAR_YPOS]);
         psLineAdd (line, "%8.3f", source->psfMag);
         psLineAdd (line, "%6.3f", dmag);
-        psLineAdd (line, "%9.2f", PAR[0]);
+        psLineAdd (line, "%9.2f", PAR[PM_PAR_SKY]);
         psLineAdd (line, "%9.3f", axes.major);
         psLineAdd (line, "%9.3f", axes.minor);
Index: trunk/psModules/src/objects/pmSourceIO_RAW.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_RAW.c	(revision 8880)
+++ trunk/psModules/src/objects/pmSourceIO_RAW.c	(revision 8882)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -84,8 +84,9 @@
 
         // dPos is positional error, dMag is mag error
-        dPos = hypot (dPAR[2], dPAR[3]);
+        dPos = hypot (dPAR[PM_PAR_XPOS], dPAR[PM_PAR_YPOS]);
 
         fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
-                 PAR[2], PAR[3], PAR[0], source->psfMag, source->errMag, dPos);
+                 PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], PAR[PM_PAR_SKY],
+                 source->psfMag, source->errMag, dPos);
 
         for (j = 4; j < model->params->n; j++) {
@@ -142,8 +143,9 @@
         // dPos is shape error
         // XXX these are hardwired for SGAUSS
-        dPos = hypot ((dPAR[4] / PAR[4]), (dPAR[5] / PAR[5]));
+        dPos = hypot ((dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]), (dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]));
 
         fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
-                 PAR[2], PAR[3], PAR[0], source->extMag, source->errMag, dPos);
+                 PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], PAR[PM_PAR_SKY],
+                 source->extMag, source->errMag, dPos);
 
         for (j = 4; j < model->params->n; j++) {
Index: trunk/psModules/src/objects/pmSourceIO_SX.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_SX.c	(revision 8880)
+++ trunk/psModules/src/objects/pmSourceIO_SX.c	(revision 8882)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 12:24:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -60,16 +60,16 @@
         // pmSourceSextractType (source, &type, &flags);
 
-        shape.sx  = PAR[4];
-        shape.sy  = PAR[5];
-        shape.sxy = PAR[6];
+        shape.sx  = PAR[PM_PAR_SXX];
+        shape.sy  = PAR[PM_PAR_SYY];
+        shape.sxy = PAR[PM_PAR_SXY];
         axes = psEllipseShapeToAxes (shape);
 
         psLineInit (line);
         psLineAdd (line, "%5.2f",  0.0); // should be type
-        psLineAdd (line, "%11.3f", PAR[2]);
-        psLineAdd (line, "%11.3f", PAR[3]);
+        psLineAdd (line, "%11.3f", PAR[PM_PAR_XPOS]);
+        psLineAdd (line, "%11.3f", PAR[PM_PAR_YPOS]);
         psLineAdd (line, "%9.4f",  source->psfMag);
         psLineAdd (line, "%9.4f",  source->errMag);
-        psLineAdd (line, "%13.4f", PAR[0]);
+        psLineAdd (line, "%13.4f", PAR[PM_PAR_SKY]);
         psLineAdd (line, "%9.2f",  axes.major);
         psLineAdd (line, "%9.2f",  axes.minor);
