Index: trunk/psphot/src/psphotReadoutFindPSF.c
===================================================================
--- trunk/psphot/src/psphotReadoutFindPSF.c	(revision 26894)
+++ trunk/psphot/src/psphotReadoutFindPSF.c	(revision 28013)
@@ -8,5 +8,5 @@
 
     // set the photcode for the PSPHOT.INPUT
-    if (!psphotAddPhotcode(config, view)) {
+    if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
         psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
         return false;
@@ -14,5 +14,5 @@
 
     // Generate the mask and variance images, including the user-defined analysis region of interest
-    psphotSetMaskAndVariance (config, view);
+    psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
 
     // Note that in this implementation, we do NOT model the background and we do not
@@ -21,11 +21,11 @@
     // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
     // XXX we assume a single set of input sources is supplied
-    if (!psphotDetectionsFromSources (config, view, inSources)) {
+    if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {
         psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
-        return psphotReadoutCleanup(config, view);
+        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     }
 
     // construct detections->newSources and measure basic stats (moments, local sky)
-    if (!psphotSourceStats(config, view, true)) {
+    if (!psphotSourceStats(config, view, "PSPHOT.INPUT", true)) {
         psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
 	return false;
@@ -33,5 +33,5 @@
 
     // peak flux is wrong : use the peak measured in the moments analysis:
-    if (!psphotRepairLoadedSources(config, view)) {
+    if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {
         psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources");
 	return false;
@@ -39,17 +39,17 @@
 
     // classify sources based on moments, brightness (psf is not known)
-    if (!psphotRoughClass (config, view)) {
+    if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
         psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class");
-        return psphotReadoutCleanup (config, view);
+        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     }
 
-    if (!psphotImageQuality (config, view)) {
+    if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) {
         psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality");
-        return psphotReadoutCleanup(config, view);
+        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     }
 
-    if (!psphotChoosePSF(config, view)) {
+    if (!psphotChoosePSF(config, view, "PSPHOT.INPUT")) {
         psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
-        return psphotReadoutCleanup(config, view);
+        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     }
 
@@ -59,23 +59,23 @@
     // fits from that analysis, or run the linear PSF fit for all objects currently in hand
     // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
-    psphotGuessModels (config, view);
+    psphotGuessModels (config, view, "PSPHOT.INPUT");
 # endif
 
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
-    psphotMergeSources (config, view); 
+    psphotMergeSources (config, view, "PSPHOT.INPUT"); 
 
 # if 0
     // measure aperture photometry corrections
-    if (!psphotApResid (config, view)) {
+    if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
         psLogMsg ("psphot", 3, "failed on psphotApResid");
-        return psphotReadoutCleanup (config, view);
+        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     }
 # endif
 
     // drop the references to the image pixels held by each source
-    psphotSourceFreePixels(config, view);
+    psphotSourceFreePixels(config, view, "PSPHOT.INPUT");
 
     // create the exported-metadata and free local data
-    return psphotReadoutCleanup(config, view);
+    return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
 }
