Index: /branches/eam_branches/ipp-20130711/psphot/src/psphotExtendedSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20130711/psphot/src/psphotExtendedSourceFits.c	(revision 36032)
+++ /branches/eam_branches/ipp-20130711/psphot/src/psphotExtendedSourceFits.c	(revision 36033)
@@ -304,5 +304,5 @@
 
 // XXX TEST 
-	    if (!isInteractive && false) {
+	    if (!isInteractive) {
 		if (!psThreadJobAddPending(job)) {
 		    psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
Index: /branches/eam_branches/ipp-20130711/psphot/src/psphotSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20130711/psphot/src/psphotSourceFits.c	(revision 36032)
+++ /branches/eam_branches/ipp-20130711/psphot/src/psphotSourceFits.c	(revision 36033)
@@ -558,5 +558,5 @@
 }
 
-# define TIMING 1
+# define TIMING 0
 
 bool psphotSersicModelGuessPCM (pmPCMdata *pcm, pmSource *source, psImageMaskType maskVal, float psfSize);
@@ -759,9 +759,9 @@
 
 // float indexGuessInv[] = {0.5, 0.33, 0.25, 0.167, 0.125, 0.083};
-float indexGuessInv[] = {0.5, 0.25, 0.167, 0.125};
-# define N_INDEX_GUESS_INV 4
-
-float reffGuess[] = {3.0, 10.0, 30.0};
-# define N_REFF_GUESS 3
+float indexGuessInv[] = {0.5, 0.4, 0.3, 0.25, 0.20, 0.15, 0.125};
+# define N_INDEX_GUESS_INV 7
+
+float reffGuess[] = {3.0, 10.0, 20.0, 30.0, 40.0};
+# define N_REFF_GUESS 5
 
 // A sersic model is very sensitive to the index.  attempt to find the index first by grid search in just the index
@@ -882,6 +882,6 @@
 		rMin = reffGuess[j];
 	    }
-	    fprintf (stderr, "%d | %f %f %f %f | %f %f %f %f", i, indexGuessInv[i], reffGuess[j], Io, Chisq, sMin, rMin, iMin, xMin);
-	    fprintf (stderr, "\n");
+	    // fprintf (stderr, "%d | %f %f %f %f | %f %f %f %f", i, indexGuessInv[i], reffGuess[j], Io, Chisq, sMin, rMin, iMin, xMin);
+	    // fprintf (stderr, "\n");
 	}
     }
Index: /branches/eam_branches/ipp-20130711/psphot/test/tap_psphot_galaxygrid.pro
===================================================================
--- /branches/eam_branches/ipp-20130711/psphot/test/tap_psphot_galaxygrid.pro	(revision 36032)
+++ /branches/eam_branches/ipp-20130711/psphot/test/tap_psphot_galaxygrid.pro	(revision 36033)
@@ -28,4 +28,5 @@
 $RefOptions = $RefOptions -Df STARS.DENSITY 10.0
 $RefOptions = $RefOptions -Df STARS.SIGMA.LIM 0.5
+$RefOptions = $RefOptions -nx 3000 -ny 3000
 
 # options for the simulated images (using the refimage for the stars)
@@ -33,4 +34,5 @@
 $FakeOptions = $FakeOptions -exptime 30.0
 $FakeOptions = $FakeOptions -D PSF.MODEL PS_MODEL_GAUSS
+$FakeOptions = $FakeOptions -nx 3000 -ny 3000
   
 # sample alternate options:
@@ -65,6 +67,6 @@
 $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN 1.66
 $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX 1.66
-$FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 120
-$FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 120
+$FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 300
+$FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 300
 
 list fwhm 
@@ -89,6 +91,6 @@
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MIN 0 
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MAX 180
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 120
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 120
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 300
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 300
   $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN 1.0
   $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX 1.0
@@ -149,6 +151,6 @@
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MIN 0 
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MAX 180
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 120
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 120
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 300
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 300
   $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN 1.0
   $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX 1.0
@@ -288,6 +290,6 @@
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MIN 0 
   $FakeConfig = $FakeConfig -Df GALAXY.THETA.MAX 180
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 120
-  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 120
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 300
+  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 300
   $FakeConfig = $FakeConfig -D GALAXY.MODEL PS_MODEL_SERSIC
   $BaseConfig = $FakeConfig
@@ -307,5 +309,5 @@
 	  
           sprint name "$1/sersic.%02d" $Nseq
-          # mkexp $name $fwhm SERSIC
+          mkexp $name $fwhm SERSIC
 	  echo "$Nseq : $index $Rmajor $Aratio $fwhm"
 	  $Nseq ++
@@ -339,4 +341,11 @@
 
 macro grid.fitexp.sersic
+  if ($0 != 3)
+    echo "USAGE: grid.fitexp.sersic (srcdir) (outdir)"
+    break
+  end
+
+  mkdir $2
+
   $Nseq = 0
   foreach index 1 2 3 4
@@ -345,5 +354,5 @@
         foreach fwhm 0.8 1.0 1.5
           sprint name "sersic.%02d" $Nseq
-          fitexp $name $name.fit SER\_CONV
+          fitexp $1/$name $2/$name.fit SER\_CONV
 	  $Nseq ++
         end
