Index: trunk/ppImage/src/ppImageParseCamera.c
===================================================================
--- trunk/ppImage/src/ppImageParseCamera.c	(revision 33848)
+++ trunk/ppImage/src/ppImageParseCamera.c	(revision 35081)
@@ -303,4 +303,5 @@
     }
 
+
     // chipImage    -> psphotInput  (pmFPAfileDefineFromFile)       : fpa is constructed
     // psphotInput  -> psphotOutput (pmFPAfileDefineOutputFromFile) : fpa is equated
@@ -387,4 +388,25 @@
     // the input data is the same as the outImage data : force the free levels to match
     input->freeLevel = PS_MIN(outImage->freeLevel, input->freeLevel);
+
+    // define the continuity corrected background model files
+    if (options->doBackgroundContinuity) {
+      pmFPAfile *bkgMosaicModel = pmFPAfileDefineFromFPA(config,input->fpa, 1, 1,  "PPIMAGE.BACKMDL");
+      if (!bkgMosaicModel) {
+	psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BACKMDL"));
+	psFree(options);
+	return NULL;
+      }
+      if (bkgMosaicModel->type != PM_FPA_FILE_IMAGE) {
+	psError(PS_ERR_IO, true, "PPIMAGE.BACKMDL is not of type IMAGE");
+	psFree(options);
+	return NULL;
+
+      }
+      bkgMosaicModel->save = options->doBackgroundContinuity;
+      //      bkgMosaicModel->freeLevel = PS_MIN(bkgMosaicModel->freeLevel, PM_FPA_LEVEL_FPA);
+      bkgMosaicModel->freeLevel = PM_FPA_LEVEL_FPA;
+      bkgMosaicModel->dataLevel = bkgMosaicModel->dataLevel;
+      bkgMosaicModel->fileLevel = PS_MIN(bkgMosaicModel->fileLevel, bkgMosaicModel->dataLevel);
+    }
 
     // define the binned target files (which may just be carriers for some camera configurations)
@@ -497,5 +519,5 @@
         chipVariance->save = false;
     }
-
+    
     if (psTraceGetLevel("ppImage.config") > 0) {
         // Get a look inside all the files.
