Index: /branches/eam_branches/ipp-20110213/ppStack/src/ppStackConvolve.c
===================================================================
--- /branches/eam_branches/ipp-20110213/ppStack/src/ppStackConvolve.c	(revision 30805)
+++ /branches/eam_branches/ipp-20110213/ppStack/src/ppStackConvolve.c	(revision 30806)
@@ -238,4 +238,5 @@
 	    // M_app = m_inst + ZP + 2.5*log(exptime), where exptime in the output is sumExposure
             psMetadataItem *zpItem = psMetadataLookup(inCell->parent->parent->concepts, "FPA.ZP");
+	    float inZP = zpItem->data.F32;
             zpItem->data.F32 += options->norm->data.F32[i] + 2.5*log10(options->sumExposure);
 
@@ -244,10 +245,15 @@
 
             expItem = psMetadataLookup(inCell->concepts, "CELL.EXPOSURE");
+	    float inExptime = expItem->data.F32;
             expItem->data.F32 = options->sumExposure;
 
 	    // flux_out = flux_in * ten(-0.4*norm) -- save the individual saturation values
-            psMetadataItem *satItem = psMetadataLookup(inCell->concepts, "CELL.EXPOSURE");
+            psMetadataItem *satItem = psMetadataLookup(inCell->concepts, "CELL.SATURATION");
+	    float inSat = satItem->data.F32;
 	    satItem->data.F32 *= pow(10.0, -0.4*options->norm->data.F32[i]);
             psVectorAppend (satValues, satItem->data.F32);
+
+	    psLogMsg("ppStack", PS_LOG_INFO, "image %d mods : zp %f -> %f, exptime %f -> %f, sat %f -> %f", 
+		     i, inZP, zpItem->data.F32, inExptime, expItem->data.F32, inSat, satItem->data.F32);
         }
 
@@ -311,4 +317,5 @@
 	// this case, the best value for CELL.SATURATION is the 2nd highest value in the list.
 	// If not, it should be the higest value in the list
+	bool mdok = false;
 	bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
 	psVectorSortInPlace(satValues);
@@ -327,4 +334,6 @@
         UPDATE_CONCEPT(unconvCell, "CELL.SATURATION", satBest);
         UPDATE_CONCEPT(unconvFPA,  "FPA.ZP",        options->zp);
+
+	psLogMsg("ppStack", PS_LOG_INFO, "stack adjust metadata values : zp %f, exptime %f, sat %f", options->zp, options->sumExposure, satBest);
 
         if (options->stats) {
