Index: branches/eam_branches/20091201/ppStack/src/ppStackMatch.c
===================================================================
--- branches/eam_branches/20091201/ppStack/src/ppStackMatch.c	(revision 26610)
+++ branches/eam_branches/20091201/ppStack/src/ppStackMatch.c	(revision 26671)
@@ -316,4 +316,16 @@
             int optOrder = psMetadataLookupS32(&mdok, ppsub, "OPTIMUM.ORDER"); // Order for search
             float poorFrac = psMetadataLookupF32(&mdok, ppsub, "POOR.FRACTION"); // Fraction for "poor"
+
+            bool scale = psMetadataLookupBool(NULL, recipe, "SCALE");        // Scale kernel parameters?
+            float scaleRef = psMetadataLookupF32(NULL, recipe, "SCALE.REF"); // Reference for scaling
+            float scaleMin = psMetadataLookupF32(NULL, recipe, "SCALE.MIN"); // Minimum for scaling
+            float scaleMax = psMetadataLookupF32(NULL, recipe, "SCALE.MAX"); // Maximum for scaling
+            if (!isfinite(scaleRef) || !isfinite(scaleMin) || !isfinite(scaleMax)) {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                        "Scale parameters (SCALE.REF=%f, SCALE.MIN=%f, SCALE.MAX=%f) not set in recipe.",
+                        scaleRef, scaleMin, scaleMax);
+                return false;
+            }
+
 
             // These values are specified specifically for stacking
@@ -410,6 +422,23 @@
                 }
             } else {
+                // Scale the input parameters
+                psVector *widthsCopy = psVectorCopy(NULL, widths, PS_TYPE_F32); // Copy of kernel widths
+                if (scale && !pmSubtractionParamsScale(&size, &footprint, widthsCopy,
+                                                       options->inputSeeing->data.F32[index],
+                                                       options->targetSeeing, scaleRef, scaleMin, scaleMax)) {
+                    psError(PS_ERR_UNKNOWN, false, "Unable to scale kernel parameters");
+                    psFree(fake);
+                    psFree(optWidths);
+                    psFree(stampSources);
+                    psFree(conv);
+                    psFree(widthsCopy);
+                    if (threads > 0) {
+                        pmSubtractionThreadsFinalize(readout, fake);
+                    }
+                    return false;
+                }
+
                 if (!pmSubtractionMatch(NULL, conv, fake, readout, footprint, stride, regionSize, spacing,
-                                        threshold, stampSources, stampsName, type, size, order, widths,
+                                        threshold, stampSources, stampsName, type, size, order, widthsCopy,
                                         orders, inner, ringsOrder, binning, penalty,
                                         optimum, optWidths, optOrder, optThresh, iter, rej, sysError, skyErr,
@@ -421,4 +450,5 @@
                     psFree(stampSources);
                     psFree(conv);
+                    psFree(widthsCopy);
                     if (threads > 0) {
                         pmSubtractionThreadsFinalize(readout, fake);
@@ -426,4 +456,5 @@
                     return false;
                 }
+                                              psFree(widthsCopy);
             }
 
Index: branches/eam_branches/20091201/ppStack/src/ppStackOptions.c
===================================================================
--- branches/eam_branches/20091201/ppStack/src/ppStackOptions.c	(revision 26610)
+++ branches/eam_branches/20091201/ppStack/src/ppStackOptions.c	(revision 26671)
@@ -20,4 +20,5 @@
     psFree(options->convVariances);
     psFree(options->psf);
+    psFree(options->inputSeeing);
     psFree(options->inputMask);
     psFree(options->sourceLists);
@@ -54,4 +55,6 @@
     options->num = 0;
     options->psf = NULL;
+    options->inputSeeing = NULL;
+    options->targetSeeing = NAN;
     options->inputMask = NULL;
     options->sourceLists = NULL;
Index: branches/eam_branches/20091201/ppStack/src/ppStackOptions.h
===================================================================
--- branches/eam_branches/20091201/ppStack/src/ppStackOptions.h	(revision 26610)
+++ branches/eam_branches/20091201/ppStack/src/ppStackOptions.h	(revision 26671)
@@ -18,4 +18,6 @@
     // Prepare
     pmPSF *psf;                         // Target PSF
+    psVector *inputSeeing;              // Input seeing FWHMs
+    float targetSeeing;                 // Target seeing FWHM
     float sumExposure;                  // Sum of exposure times
     psVector *inputMask;                // Mask for inputs
Index: branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c
===================================================================
--- branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c	(revision 26610)
+++ branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c	(revision 26671)
@@ -176,16 +176,16 @@
 
 
-	bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
-	psArray *sources = NULL;
-
-	if (options->convolve || options->matchZPs || redoPhot) {
-	    pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
-	    sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
-	    if (!sources) {
-		psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
-		return NULL;
-	    }
-	    options->sourceLists->data[index] = psMemIncrRefCounter(sources);
-	}
+        bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
+        psArray *sources = NULL;
+
+        if (options->convolve || options->matchZPs || redoPhot) {
+            pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
+            sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
+            if (!sources) {
+                psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
+                return NULL;
+            }
+            options->sourceLists->data[index] = psMemIncrRefCounter(sources);
+        }
 
         // Re-do photometry if we don't trust the source lists
@@ -194,7 +194,7 @@
             pmFPAfileActivate(config->files, false, NULL);
             ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index);
-	    if (options->convolve) {
-		pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
-	    }
+            if (options->convolve) {
+                pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
+            }
             pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File
             pmFPAview *photView = ppStackFilesIterateDown(config);
@@ -225,4 +225,23 @@
     }
     psFree(fileIter);
+
+    psString log = psStringCopy("Input seeing FWHMs:\n"); // Log message
+    bool havePSFs = false;                                // Do we have any PSFs?
+    options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32);
+    psVectorInit(options->inputSeeing, NAN);
+    for (int i = 0; i < num; i++) {
+        pmPSF *psf = psfs->data[i];     // PSF for image
+        if (!psf) {
+            continue;
+        }
+        havePSFs = true;
+        float fwhm = pmPSFtoFWHM(psf, 0.5 * numCols, 0.5 * numRows); // FWHM for image
+        psStringAppend(&log, "Input %d: %f\n", i, fwhm);
+        options->inputSeeing->data.F32[i] = fwhm;
+    }
+    if (havePSFs) {
+        psLogMsg("ppStack", PS_LOG_INFO, "%s", log);
+    }
+    psFree(log);
 
     // Generate target PSF
@@ -237,4 +256,6 @@
         psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "PSF.TARGET", PS_DATA_UNKNOWN,
                          "Target PSF for stack", options->psf);
+        options->targetSeeing = pmPSFtoFWHM(options->psf, 0.5 * numCols, 0.5 * numRows); // FWHM for target
+        psLogMsg("ppStack", PS_LOG_INFO, "Target seeing FWHM: %f\n", options->targetSeeing);
 
         pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSTACK.OUTPUT"); // Output chip
