Index: trunk/ippconfig/recipes/ppStack.config
===================================================================
--- trunk/ippconfig/recipes/ppStack.config	(revision 34859)
+++ trunk/ippconfig/recipes/ppStack.config	(revision 34860)
@@ -32,4 +32,6 @@
 TARGET.FRAC	F32	0.1		# Minimum flux fraction for target PSF
 TARGET.MINMAG	F32	3.0		# Minimum magnitude difference to tolerate in stamp
+
+BACKGROUND.MODEL    BOOL   FALSE        # Construct a stacked version of the warp stage background
 
 RENORM		BOOL	TRUE		# Renormalise weight maps?
Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 34859)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 34860)
@@ -41,8 +41,9 @@
     if (options->quality) return true; // Can't do anything else
 
+    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
+
     // Ensure sufficient inputs
     {
         int numGood = stackSummary(options, "initial combination");
-        psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
         bool safe = psMetadataLookupBool(NULL, recipe, "SAFE"); // Be safe when combining
         if (safe && numGood <= 1) {
@@ -62,6 +63,8 @@
     }
 
+    bool doBackground = psMetadataLookupBool(NULL, recipe, "BACKGROUND.MODEL");
+
     // Prepare for combination
-    if (!ppStackCombinePrepare("PPSTACK.OUTPUT", "PPSTACK.OUTPUT.EXP", "PPSTACK.OUTPUT.BKGMODEL", PPSTACK_FILES_STACK, stack, options, config)) {
+    if (!ppStackCombinePrepare("PPSTACK.OUTPUT", "PPSTACK.OUTPUT.EXP", doBackground ? "PPSTACK.OUTPUT.BKGMODEL" : NULL, PPSTACK_FILES_STACK, stack, options, config)) {
         psError(psErrorCodeLast(), false, "Unable to prepare for combination.");
         psFree(stack);
@@ -143,5 +146,5 @@
 
     // Generate median background stack here.
-    if (!ppStackCombineBackground(stack, options, config)) {
+    if (doBackground && !ppStackCombineBackground(stack, options, config)) {
       psError(psErrorCodeLast(), false, "Unable to generate median of background images.");
       psFree(stack);
