Index: /trunk/psphot/src/psphotStackMatchPSFs.c
===================================================================
--- /trunk/psphot/src/psphotStackMatchPSFs.c	(revision 34351)
+++ /trunk/psphot/src/psphotStackMatchPSFs.c	(revision 34352)
@@ -4,4 +4,6 @@
 {
     bool status = true;
+
+    psLogMsg ("psphot", PS_LOG_INFO, "--- psphotStack Match PSFs ---");
 
     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PSPHOT"); 
@@ -44,5 +46,5 @@
     }
 
-    // loop over the available readouts (ignore chisq image)
+    // loop over the available readouts (ignore chisq image)psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Source Stats ---");
     for (int i = 0; i < num; i++) { 
 	if (!psphotStackMatchPSFsReadout (config, view, options, i)) {
@@ -57,9 +59,11 @@
 
 // convolve the image to match desired PSF
-// XXX is this code consistent with 'convolve' = false?
+// XXX is this code consistent with 'convolve' = false?  XXX: No
 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) {
 
     psImageMaskType maskValue;
     psImageMaskType markValue;
+
+    psLogMsg("psphot", PS_LOG_DETAIL, "-- starting PSF matching for readout %d --", index);
 
     // get the PSPHOT.MASK value from the config
@@ -102,4 +106,20 @@
 	saveMatchData(readoutOut, options, index);
     }
+    bool notMatched = psMetadataLookupBool(NULL, readoutOut->analysis, "NOT.PSF.MATCHED");
+    if (notMatched) {
+        if (!readoutOut->image) {
+            // our images got freed in the matching process. Recreate them so that they
+            // are available when sources are copied to this readout.
+            readoutOut->image = psImageCopy(NULL, readoutSrc->image, PS_TYPE_F32);
+            if (readoutSrc->variance) {
+                psFree(readoutOut->variance);
+                readoutOut->variance = psImageCopy(NULL, readoutSrc->variance, PS_TYPE_F32);
+            }
+            if (readoutSrc->mask) {
+                psFree(readoutOut->mask);
+                readoutOut->mask = psImageCopy(NULL, readoutSrc->mask, PS_TYPE_IMAGE_MASK);
+            }
+        }
+    }
 
     // renormalize the stack variances to have sigma = 1.0
@@ -111,11 +131,10 @@
     // save the output fwhm values in the readout->analysis.  we may have / will have multiple output PSF sizes,
     // so we save this in a vector.  if the vector is not yet defined, create it
-    // Skip this if the readout deconvolution fraction was over the limit.
+    // Skip this if psf matching failed for this readout. For example if deconvolution fraction was over the limit.
     // NOTE: fwhmValues as defined here has 1 + nMatched PSF : 0 == unmatched
     psVector *fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32);
     psVectorAppend(fwhmValues, NAN); // XXX this corresponds to the unmatched image set
 
-    bool overLimit = psMetadataLookupBool(NULL, readoutOut->analysis, "DECONV.OVERLIMIT");
-    if (!overLimit) {
+    if (!notMatched) {
         for (int i = 0; i < options->targetSeeing->n; i++) {
             psVectorAppend(fwhmValues, options->targetSeeing->data.F32[i]);
@@ -124,5 +143,5 @@
     psMetadataAddVector(readoutSrc->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
     psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
-    psFree(fwhmValues); // drops the extra copy
+    psFree(fwhmValues); // drops this function's reference
 
     return true;
Index: /trunk/psphot/src/psphotStackMatchPSFsUtils.c
===================================================================
--- /trunk/psphot/src/psphotStackMatchPSFsUtils.c	(revision 34351)
+++ /trunk/psphot/src/psphotStackMatchPSFsUtils.c	(revision 34352)
@@ -280,4 +280,5 @@
 
     // Do the image matching
+    bool rejectReadout = false; 
     pmSubtractionKernels *kernel = psMetadataLookupPtr(&mdok, readoutSrc->analysis, PM_SUBTRACTION_ANALYSIS_KERNEL); // Conv kernel
     if (kernel) {
@@ -301,25 +302,30 @@
 
 	if (!pmSubtractionMatch(NULL, readoutOut, fake, readoutSrc, footprint, stride, regionSize, spacing, threshold, stampSources, stampsName, type, size, order, widthsCopy, orders, inner, ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, normFrac, sysError, skyErr, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac, PM_SUBTRACTION_MODE_2)) {
-	    psError(psErrorCodeLast(), false, "Unable to match images.");
-	    goto escape;
+            int errorCode = psErrorCodeLast();
+            if (errorCode == PM_ERR_SMALL_AREA) {
+                // failed to match but, don't fault. Just drop this input from measurements that need the
+                // matched readout.
+                rejectReadout = true;
+                psLogMsg("psphot", PS_LOG_WARN, "PSF match failed for input %d. Too few pixels.", index);
+            } else {
+                psError(psErrorCodeLast(), false, "Unable to match images.");
+                goto escape;
+            }
 	}
     }
 
-    // Reject image completely if the maximum deconvolution fraction exceeds the limit
+    // If the maximum deconvolution fraction exceeds the limit, reject this input for analyses that require PSF matching
     float deconvLimit = psMetadataLookupF32(NULL, stackRecipe, "DECONV.LIMIT"); // Limit on deconvolution fraction
     float deconv = psMetadataLookupF32(NULL, readoutOut->analysis, PM_SUBTRACTION_ANALYSIS_DECONV_MAX); // Max deconvolution fraction
     if (deconv > deconvLimit) {
-#if (1)
-        // XXX: don't reject the image set 
-	psWarning("Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image for matched psf analysis%d\n", deconv, deconvLimit, index);
-        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "DECONV.OVERLIMIT", PS_META_REPLACE, "", true);
-#else
-	psWarning("Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image %d\n", deconv, deconvLimit, index);
-	goto escape;
-#endif
+        rejectReadout = true;
+	psLogMsg("psphot", PS_LOG_WARN, "Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image for matched psf analysis%d\n", deconv, deconvLimit, index);
+    }
+    
+    if (rejectReadout) {
+        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", true);
     } else {
-        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "DECONV.OVERLIMIT", PS_META_REPLACE, "", false);
-    }
-
+        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", false);
+    }
     // save the PSF on the new readout->analysis:
     // if (!psMetadataAddPtr (readoutOut->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", options->psf)) {
@@ -470,6 +476,7 @@
 }
 
-// Set input to be skipped if the decovolution fraction was overlimit. Use for radial apertures
-// This interface can be potentiall be extended for other uses
+// Set input to be skipped if the analysis reports that psf matching has failed for some reason.
+// For exmaple if decovolution fraction was overlimit or the bad fraction was too high.
+//
 bool psphotStackSetInputsToSkip(pmConfig *config, const pmFPAview *view, const char *filerule, bool set) {
     int num = psphotFileruleCount(config, filerule);
@@ -487,6 +494,6 @@
         psAssert (readout, "missing readout?");
         if (set) {
-            bool overLimit = psMetadataLookupBool(&status, readout->analysis, "DECONV.OVERLIMIT");
-            psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSPHOT.SKIP.INPUT", PS_META_REPLACE, "Skip analysis", overLimit);
+            bool notMatched = psMetadataLookupBool(&status, readout->analysis, "NOT.PSF.MATCHED");
+            psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSPHOT.SKIP.INPUT", PS_META_REPLACE, "Skip analysis", notMatched);
         } else {
             psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSPHOT.SKIP.INPUT", PS_META_REPLACE, "Skip analysis", false);
