Index: /branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CFF.c
===================================================================
--- /branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CFF.c	(revision 36243)
+++ /branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CFF.c	(revision 36244)
@@ -71,7 +71,4 @@
     assert (modelType > -1);
 
-    // how to deal with this?
-    int galaxyModelType = pmModelClassGetType ("PS_MODEL_EXP");
-
     // We get the size of the table, and allocate the array of sources first because the table
     // is large and ephemeral --- when the table gets blown away, whatever is allocated after
@@ -93,5 +90,7 @@
 	unsigned int ID  = psMetadataLookupU32 (&status, row, "ID");
 	float X          = psMetadataLookupF32 (&status, row, "X");
+        assert(status);
 	float Y          = psMetadataLookupF32 (&status, row, "Y");
+        assert(status);
         float flux       = psMetadataLookupF32 (&status, row, "FLUX"); // guess at the instrumental flux
 
@@ -105,5 +104,10 @@
         float Rminor     = psMetadataLookupF32 (&status, row, "R_MINOR");
         float theta      = psMetadataLookupF32 (&status, row, "THETA");
-        float Sindex     = psMetadataLookupF32 (&status, row, "INDEX");
+
+        // XXX: we need to put a lookup table in the cff header to define the correspondence of the
+        // model type values in the cff with our models. (We want to use an interger for efficiency
+        // but the values depend on the array in pmModelClass.c
+        int   galaxyModelType = psMetadataLookupS32(&status, row, "MODEL_TYPE");
+        float Sindex     = psMetadataLookupF32 (&status, row, "INDEX"); // Should this be PAR_07 not sersic index
 
         pmSource *source = pmSourceAlloc ();
@@ -160,5 +164,5 @@
 	source->moments->Mx = X;
 	source->moments->My = Y;
-	source->moments->Mrf = kronRadius;
+	source->moments->Mrf = kronRadius * 0.4; // kronRadius is 2.5 * first radial moment
 	source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;
 	// XXX does the above cause a problem with pmSourceMoments (do we run it?)
@@ -182,14 +186,13 @@
 	    galaxyAxes.major = Rmajor;
 	    galaxyAxes.minor = Rminor;
-	    galaxyAxes.theta = theta; // XXX degrees or radians?
+	    galaxyAxes.theta = theta * PS_RAD_DEG;
 
 	    pmPSF_AxesToModel (xPAR, galaxyAxes, galaxyModelType);
 	    if (model->params->n > 7) {
-	      xPAR[PM_PAR_7] = Sindex;
+                xPAR[PM_PAR_7] = 0.5 / Sindex;
 	    }
 
 	    psArrayAdd (source->modelFits, 1, model);
 	    psFree (model);
-	    
         }
 
