Index: branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c
===================================================================
--- branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c	(revision 27883)
+++ branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c	(revision 27884)
@@ -64,20 +64,25 @@
 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) {
 
-    // find the currently selected readout
-    pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest
-    psAssert (fileRaw, "missing file?");
+    pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index);
+    if (!fileSrc) {
+	psError(PSPHOT_ERR_CONFIG, false, "desired convolution source is missing");
+	return false;
+    }
 
-    pmFPAfile *fileCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest
-    psAssert (fileCnv, "missing file?");
+    pmFPAfile *fileOut = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.IMAGE", index); // File of interest
+    psAssert (fileOut, "missing output file?");
 
-    pmReadout *readoutRaw = pmFPAviewThisReadout(view, fileRaw->fpa);
-    psAssert (readoutRaw, "missing readout?");
+    pmReadout *readoutSrc = pmFPAviewThisReadout(view, fileSrc->fpa);
+    psAssert (readoutSrc, "missing readout?");
 
-    pmReadout *readoutCnv = pmFPAviewThisReadout(view, fileCnv->fpa);
-    psAssert (readoutCnv, "missing readout?");
+    pmReadout *readoutOut = pmFPAviewThisReadout(view, fileOut->fpa);
+    if (readoutOut == NULL) {
+	readoutOut = pmFPAGenerateReadout(config, view, "PSPHOT.STACK.OUTPUT.IMAGE", fileSrc->fpa, NULL, 0);
+	psAssert (readoutOut, "missing readout?");
+    }
 
     // set NAN pixels to 'SAT'
     psImageMaskType maskVal = pmConfigMaskGet("SAT", config);
-    if (!pmReadoutMaskNonfinite(readoutRaw, maskVal)) {
+    if (!pmReadoutMaskNonfinite(readoutSrc, maskVal)) {
         psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout.");
         return false;
@@ -86,6 +91,6 @@
     // Image Matching (PSFs or just flux)
     if (options->convolve) {
-	matchKernel(config, readoutCnv, readoutRaw, options, index);
-	saveMatchData(readoutCnv, options, index);
+	matchKernel(config, readoutOut, readoutSrc, options, index);
+	saveMatchData(readoutOut, options, index);
 	// renormKernel(readoutCnv, options, index);
     } else {
@@ -97,7 +102,7 @@
     }
 
-    rescaleData(readoutCnv, config, options, index);
+    rescaleData(readoutOut, config, options, index);
 
-    dumpImage(readoutCnv, readoutRaw, index, "convolved");
+    dumpImage(readoutOut, readoutSrc, index, "convolved");
 
     return true;
