Index: /branches/eam_branches/ipp-20101103/ppImage/src/ppImagePhotom.c
===================================================================
--- /branches/eam_branches/ipp-20101103/ppImage/src/ppImagePhotom.c	(revision 29904)
+++ /branches/eam_branches/ipp-20101103/ppImage/src/ppImagePhotom.c	(revision 29905)
@@ -11,7 +11,7 @@
     pmCell *cell;
     pmReadout *readout;
-    printf("%x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
+
     psphotInit();
-    printf("%x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
+
     // find or define a pmFPAfile PSPHOT.INPUT
     pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
@@ -20,10 +20,10 @@
         return false;
     }
-    printf("%x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
+
     // we make a new copy of the output chip to keep psphot from modifying the output image
     pmChip *oldChip = pmFPAviewThisChip (view, input->src);
     pmChip *newChip = pmFPAviewThisChip (view, input->fpa);
     pmChipCopy (newChip, oldChip);
-    printf("%x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
+
     // iterate over the cells and readout for this chip
     while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
@@ -34,7 +34,7 @@
         while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
             if (! readout->data_exists) { continue; }
-	    printf("%x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
+
             // run the actual photometry analysis
-            if (!psphotReadout (config, view)) {
+            if (!psphotReadout (config, view, "PSPHOT.INPUT")) {
                 // This is likely a data quality issue
                 // XXX Split into multiple cases using error codes?
@@ -60,10 +60,4 @@
     ppImageMemoryDump("photom");
 
-    // the PSPHOT.INPUT file is a temporary file used to carry PPIMAGE.CHIP to psphotReadout
-    // XXX not sure that this is needed...
-//    pmFPAfileActivate (config->files, false, "PSPHOT.INPUT");
-
     return true;
 }
-
-// XXX do we need to deactivate all files and activate the psphot ones explicitly?
Index: /branches/eam_branches/ipp-20101103/ppStack/src/ppStackPhotometry.c
===================================================================
--- /branches/eam_branches/ipp-20101103/ppStack/src/ppStackPhotometry.c	(revision 29904)
+++ /branches/eam_branches/ipp-20101103/ppStack/src/ppStackPhotometry.c	(revision 29905)
@@ -54,8 +54,6 @@
     psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     psImageMaskType markValue = pmConfigMaskGet("MARK.VALUE", config); // Bits to use for marking
-    psMetadataAddImageMask(psphot, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE,
-                            "Bits to mask", maskValue);
-    psMetadataAddImageMask(psphot, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE,
-                           "Bits to use for mark", markValue);
+    psMetadataAddImageMask(psphot, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "Bits to mask", maskValue);
+    psMetadataAddImageMask(psphot, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "Bits to use for mark", markValue);
 
     psArray *inSources = options->sources;
@@ -67,5 +65,5 @@
 
     pmModelClassSetLimits(PM_MODEL_LIMITS_LAX);
-    if (!psphotReadoutKnownSources(config, photView, inSources)) {
+    if (!psphotReadoutKnownSources(config, photView, "PSPHOT.INPUT", inSources)) {
         // This is likely a data quality issue
         // XXX Split into multiple cases using error codes?
Index: /branches/eam_branches/ipp-20101103/pswarp/src/pswarpLoop.c
===================================================================
--- /branches/eam_branches/ipp-20101103/pswarp/src/pswarpLoop.c	(revision 29904)
+++ /branches/eam_branches/ipp-20101103/pswarp/src/pswarpLoop.c	(revision 29905)
@@ -384,5 +384,5 @@
 
         // measure the PSF using these sources
-        if (!psphotReadoutFindPSF(config, view, sources)) {
+        if (!psphotReadoutFindPSF(config, view, "PSPHOT.INPUT", sources)) {
             // This is likely a data quality issue
             // XXX Split into multiple cases using error codes?
