Index: trunk/Ohana/src/addstar/src/loadgalphot_readstars.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadgalphot_readstars.c	(revision 39514)
+++ trunk/Ohana/src/addstar/src/loadgalphot_readstars.c	(revision 39515)
@@ -61,4 +61,7 @@
   // in xfit, we have strings.  these are listed with their numerical 
   // match in the PHU.  I need to read the list of names and set up a string hash
+
+  int ModelTypeDev = -1;
+  int ModelTypeExp = -1;
 
   int ModelTypeN;
@@ -98,4 +101,10 @@
     if (!gfits_scan (&header_xfit, name, "%d", 1, &tmpnumber)) { myAbort ("fail"); }
     ModelTypeNum[i] = tmpnumber;
+    if (!strcasecmp (ModelTypeName[i], "PS_MODEL_EXP")) {
+      ModelTypeExp = ModelTypeNum[i];
+    }
+    if (!strcasecmp (ModelTypeName[i], "PS_MODEL_DEV")) {
+      ModelTypeDev = ModelTypeNum[i];
+    }
   }
 
@@ -117,4 +126,10 @@
   GET_COLUMN (xfit, INDEX,          "EXT_PAR_07",    float);
   int Nfit = Nrow;
+
+  float DEV_INDEX_VALUE = 0.5 / 4.0;
+  float EXP_INDEX_VALUE = 0.5 / 1.0;
+
+  // note that INDEX here is defined as 1.0 / (2 \nu), where \nu is the traditional sersic
+  // expression.
 
   myAssert (NcharModel < 256, "max model type name is very long: %d", NcharModel);
@@ -247,7 +262,12 @@
     stars[i].galphot.theta     = EXT_THETA[ifit];
     stars[i].galphot.thetaErr  = EXT_THETA_ERR[ifit];
-    stars[i].galphot.index     = INDEX[ifit];
     stars[i].galphot.Npix      = NPIX[i];
     stars[i].galphot.modelType = MODEL_TYPE_gal[i];
+    if (INDEX) {
+      stars[i].galphot.index     = INDEX[ifit];
+    } else {
+      if (MODEL_TYPE_gal[i] == ModelTypeDev) { stars[i].galphot.index = DEV_INDEX_VALUE; }
+      if (MODEL_TYPE_gal[i] == ModelTypeExp) { stars[i].galphot.index = EXP_INDEX_VALUE; }
+    }
     stars[i].galphot.detID     = ID_gal[i];
     stars[i].galphot.photcode  = options->photcode;
