Index: /branches/eam_branches/ipp-20120601/Ohana/src/imregister/imreg/imregclient.c
===================================================================
--- /branches/eam_branches/ipp-20120601/Ohana/src/imregister/imreg/imregclient.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/Ohana/src/imregister/imreg/imregclient.c	(revision 34078)
@@ -35,5 +35,7 @@
       exit (1);
     }
-    fscanf (f, "%d %f %f", &tmpint, &image[0].sky, &image[0].fwhm);
+    if (fscanf (f, "%d %f %f", &tmpint, &image[0].sky, &image[0].fwhm) != 3) {
+      fprintf (stderr, "error reading stats\n");
+    }
     image[0].ccd = tmpint;
     fclose (f);
@@ -51,5 +53,7 @@
     for (i = 0; i < Nentry; i++) {
       image[i] = image[0];
-      fscanf (f, "%d %f %f", &tmpint, &image[i].sky, &image[i].fwhm);
+      if (fscanf (f, "%d %f %f", &tmpint, &image[i].sky, &image[i].fwhm) != 3) {
+	fprintf (stderr, "error reading stats\n");
+      }
       image[i].seq = tmpint;
       if (image[i].seq == Nslice) continue;
Index: /branches/eam_branches/ipp-20120601/Ohana/src/imregister/spreg/modify.c
===================================================================
--- /branches/eam_branches/ipp-20120601/Ohana/src/imregister/spreg/modify.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/Ohana/src/imregister/spreg/modify.c	(revision 34078)
@@ -24,5 +24,5 @@
       if (!strncmp (spectrum[i].pathname, output.oldpath, Nold)) {
 	strcpy (tmppath, &spectrum[i].pathname[Nold]);
-	snprintf (spectrum[i].pathname, 128, "%s%s", output.newpath, tmppath);
+	snprintf (spectrum[i].pathname, 64, "%s%s", output.newpath, tmppath);
       }
     }
Index: /branches/eam_branches/ipp-20120601/Ohana/src/libautocode/def/common.h
===================================================================
--- /branches/eam_branches/ipp-20120601/Ohana/src/libautocode/def/common.h	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/Ohana/src/libautocode/def/common.h	(revision 34078)
@@ -32,5 +32,5 @@
 # define rawshort short
 
-# define DVO_IMAGE_NAME_LEN 128
+# define DVO_IMAGE_NAME_LEN 121
 
 /*** rawshort is used to handle the broken pre-autocode photreg tables
Index: /branches/eam_branches/ipp-20120601/Ohana/src/libohana/src/time.c
===================================================================
--- /branches/eam_branches/ipp-20120601/Ohana/src/libohana/src/time.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/Ohana/src/libohana/src/time.c	(revision 34078)
@@ -90,9 +90,10 @@
 
   char *p1, *p2;
-  // double tmp;
+  double tmp;
   int mode;
 
   p1 = line;
-  strtod (p1, &p2);
+  tmp = strtod (p1, &p2);
+  if (0) { fprintf (stderr, "tmp: %f\n", tmp); }
   mode = TIME_DATE;
   if (p2 == p1 + strlen (p1) - 1) {
Index: /branches/eam_branches/ipp-20120601/psLib/src/math/psMinimizePowell.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/src/math/psMinimizePowell.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/psLib/src/math/psMinimizePowell.c	(revision 34078)
@@ -367,7 +367,4 @@
     psF32 c = 0.0;
     psF32 n = 0.0;
-    psF32 fa = 0.0;
-    psF32 fb = 0.0;
-    psF32 fc = 0.0;
     psF32 fn = 0.0;
     psF32 mul = 0.0;
@@ -415,8 +412,10 @@
         PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpb, b);
         PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpc, c);
-        fa = func(tmpa, coords);
-        fb = func(tmpb, coords);
-        fc = func(tmpc, coords);
+        psF32 fb = func(tmpb, coords);
+# if (PS_TRACE_ON)
+        psF32 fa = func(tmpa, coords);
+        psF32 fc = func(tmpc, coords);
         psTrace("psLib.math", 6, "LineMin: f(%f %f %f) is (%f %f %f)\n", a, b, c, fa, fb, fc);
+# endif
 
         // We determine which is the biggest segment in [a,b,c] then split
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/pmPSFtryMakePSF.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/pmPSFtryMakePSF.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/pmPSFtryMakePSF.c	(revision 34078)
@@ -231,9 +231,6 @@
 	// XXX we are using the same stats structure on each pass: do we need to re-init it?
 	// XXX we hardwire this to SAMPLE stats above (psphotChoosePSF.c), hardwire here instead?
-	psStatsOptions meanOption = psStatsMeanOption(psf->psfTrendStats->options);
-	psStatsOptions stdevOption = psStatsStdevOption(psf->psfTrendStats->options);
-
+     
 	pmTrend2D *trend = NULL;
-	float mean, stdev;
 
 	// XXX we are using the same stats structure on each pass: do we need to re-init it?
@@ -249,7 +246,14 @@
 	    return true;
 	}
+
+# if (PS_TRACE_ON)
+	float mean, stdev;
+	psStatsOptions meanOption = psStatsMeanOption(psf->psfTrendStats->options);
+	psStatsOptions stdevOption = psStatsStdevOption(psf->psfTrendStats->options);
 	mean = psStatsGetValue (trend->stats, meanOption);
 	stdev = psStatsGetValue (trend->stats, stdevOption);
 	psTrace ("psModules.objects", 4, "clipped E0 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e0->n);
+# endif
+
         if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map);
 	pmSourceVisualPSFModelResid (trend, x, y, e0, srcMask);
@@ -264,7 +268,9 @@
 	    return true;
 	}
+# if (PS_TRACE_ON)
 	mean = psStatsGetValue (trend->stats, meanOption);
 	stdev = psStatsGetValue (trend->stats, stdevOption);
 	psTrace ("psModules.objects", 4, "clipped E1 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e1->n);
+# endif
         if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map);
 	pmSourceVisualPSFModelResid (trend, x, y, e1, srcMask);
@@ -279,7 +285,9 @@
 	    return true;
 	}
+# if (PS_TRACE_ON)
 	mean = psStatsGetValue (trend->stats, meanOption);
 	stdev = psStatsGetValue (trend->stats, stdevOption);
 	psTrace ("psModules.objects", 4, "clipped E2 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e2->n);
+# endif
         if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map);
 	pmSourceVisualPSFModelResid (trend, x, y, e2, srcMask);
Index: /branches/eam_branches/ipp-20120601/psphot/src/psphotSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psphot/src/psphotSourceFits.c	(revision 34077)
+++ /branches/eam_branches/ipp-20120601/psphot/src/psphotSourceFits.c	(revision 34078)
@@ -224,14 +224,4 @@
     if (source->type == PM_SOURCE_TYPE_DEFECT) return false;
     if (source->type == PM_SOURCE_TYPE_SATURATED) return false;
-
-# define TEST_X -420.0
-# define TEST_Y 300.0
-   
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	fprintf (stderr, "test galaxy\n");
-    }
-
-# undef TEST_X
-# undef TEST_Y
 
     // set the radius based on the footprint (also sets the mask pixels)
@@ -513,11 +503,4 @@
     }
 
-# define TEST_X -540.0
-# define TEST_Y 540.0
-   
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5);
-    }
-
     float t1, t2, t4, t5;
     if (TIMING) { psTimerStart ("psphotFitPCM"); }
@@ -569,8 +552,4 @@
     }
 
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0);
-    }
-
     // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0);
     psFree (pcm);
@@ -578,7 +557,4 @@
     return model;
 }
-
-# undef TEST_X
-# undef TEST_Y
 
 // note that these should be 1/2n of the standard sersic index
@@ -603,11 +579,4 @@
     float xMin = NAN;
     float chiSquare[N_INDEX_GUESS];
-
-# define TEST_X -540.0
-# define TEST_Y 540.0
-   
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5);
-    }
 
     for (int i = 0; i < N_INDEX_GUESS; i++) {
@@ -635,8 +604,4 @@
     assert (iMin >= 0);
 
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0);
-    }
-
     model->flags = PM_MODEL_STATUS_NONE; // do not attempt to handle failures here, let the next iteration deal with it
     model->params->data.F32[PM_PAR_7] = 0.5/indexGuess[iMin];
@@ -666,8 +631,4 @@
     float xMin = NAN;
     float chiSquare[N_INDEX_GUESS];
-
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5);
-    }
 
     for (int i = 0; i < N_INDEX_GUESS; i++) {
@@ -701,8 +662,4 @@
     }
     assert (iMin >= 0);
-    
-    if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) {
-	psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0);
-    }
 
     model->flags = PM_MODEL_STATUS_NONE; // do not attempt to handle failures here, let the next iteration deal with it
