Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 16850)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 16854)
@@ -227,4 +227,5 @@
 
     // Preparation iteration: Load the sources, and get a target PSF model
+    psTrace("ppStack", 1, "Determining target PSF....\n");
     pmReadout *sources = NULL;          // Readout with sources to use for PSF matching
     pmPSF *targetPSF = NULL;            // Target PSF
@@ -314,8 +315,10 @@
 
     // Generate convolutions and write them to disk
+    psTrace("ppStack", 1, "Convolving inputs to target PSF....\n");
     psArray *cells = psArrayAlloc(num); // Cells for convolved images --- a handle for reading again
     psArray *subKernels = psArrayAlloc(num); // Subtraction kernels --- required in the stacking
     psArray *subRegions = psArrayAlloc(num); // Subtraction regions --- required in the stacking
     for (int i = 0; i < num; i++) {
+        psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num);
         pmFPAfileActivate(config->files, false, NULL);
         psArray *files = fileActivationSingle(config, convolveFiles, true, i);
@@ -362,4 +365,5 @@
 
     // Stack the convolved files
+    psTrace("ppStack", 1, "Initial stack of convolved images....\n", i, num);
     {
         pmFPAfileActivate(config->files, false, NULL);
@@ -412,4 +416,5 @@
         bool more = true;               // More to read?
         for (int numChunk = 0; more; numChunk++) {
+            psTrace("ppStack", 2, "Initial stack of chunk %d....\n", numChunk);
             for (int i = 0; i < num; i++) {
                 pmReadout *readout = readouts->data[i];
@@ -429,8 +434,8 @@
             }
 
-#ifdef TESTING
+#ifndef PS_NO_TRACE
             {
                 pmReadout *ro = readouts->data[0];
-                psTrace("ppStack", 1, "Stack: [%d:%d,%d:%d]\n", ro->col0, ro->col0 + ro->image->numCols,
+                psTrace("ppStack", 4, "Stack: [%d:%d,%d:%d]\n", ro->col0, ro->col0 + ro->image->numCols,
                         ro->row0, ro->row0 + ro->image->numRows);
             }
@@ -482,6 +487,8 @@
 
         // Read convolutions by chunks
+        psTrace("ppStack", 2, "Final stack of convolved images....\n");
         more = true;
         for (int numChunk = 0; more; numChunk++) {
+            psTrace("ppStack", 2, "Final stack of chunk %d....\n", numChunk);
             for (int i = 0; i < num; i++) {
                 pmReadout *readout = readouts->data[i];
@@ -500,8 +507,8 @@
             }
 
-#ifdef TESTING
+#ifndef PS_NO_TRACE
             {
                 pmReadout *ro = readouts->data[0];
-                psTrace("ppStack", 1, "Stack: [%d:%d,%d:%d]\n", ro->col0, ro->col0 + ro->image->numCols,
+                psTrace("ppStack", 4, "Stack: [%d:%d,%d:%d]\n", ro->col0, ro->col0 + ro->image->numCols,
                         ro->row0, ro->row0 + ro->image->numRows);
             }
@@ -549,14 +556,17 @@
         psFree(weightFits);
 
-        if (psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY") &&
-            !ppStackPhotometry(config, outRO, view)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on output.");
-            psFree(outRO);
-            psFree(view);
-            return false;
+        if (psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY")) {
+            psTrace("ppStack", 1, "Photometering stacked image....\n");
+            if (!ppStackPhotometry(config, outRO, view)) {
+                psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on output.");
+                psFree(outRO);
+                psFree(view);
+                return false;
+            }
         }
 
         // Statistics on output
         if (stats) {
+            psTrace("ppStack", 1, "Gathering statistics on stacked image....\n");
             ppStatsFPA(stats, outCell->parent->parent, view, maskBlank, config);
         }
