Index: trunk/ppStack/src/ppStackPSF.c
===================================================================
--- trunk/ppStack/src/ppStackPSF.c	(revision 25480)
+++ trunk/ppStack/src/ppStackPSF.c	(revision 26898)
@@ -14,4 +14,6 @@
                   const psArray *psfs, const psVector *inputMask)
 {
+    bool mdok = false;
+
 #ifndef TESTING
     // Get the recipe values
@@ -24,4 +26,11 @@
     int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF
 
+    psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in
+    if (!mdok || !maskValStr) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to find MASK.VAL in recipe");
+        return false;
+    }
+    psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask
+
     for (int i = 0; i < psfs->n; i++) {
         if (inputMask->data.U8[i]) {
@@ -32,6 +41,5 @@
 
     // Solve for the target PSF
-    pmPSF *psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel,
-                               psfOrder, psfOrder);
+    pmPSF *psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel, psfOrder, psfOrder, maskVal);
     if (!psf) {
         psError(PS_ERR_UNKNOWN, false, "Unable to determine output PSF.");
