Index: /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c	(revision 34059)
+++ /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c	(revision 34060)
@@ -471,8 +471,8 @@
             psRegion *region = regItem->data.V; // Region of interest
             psMetadataItem *modeItem = psMetadataGetAndIncrement(modeIter); // Item with mode
-            psAssert(modeItem && modeItem->type == PS_TYPE_S32, "Expect subtraction mode");
+            psAssert(modeItem && modeItem->type == PS_DATA_S32, "Expect subtraction mode");
             pmSubtractionMode mode = modeItem->data.S32; // Subtraction mode
             psMetadataItem *normItem = psMetadataGetAndIncrement(normIter); // Item with normalisation
-            psAssert(normItem && normItem->type == PS_TYPE_F32 && isfinite(normItem->data.F32),
+            psAssert(normItem && normItem->type == PS_DATA_F32 && isfinite(normItem->data.F32),
                      "Expect normalisation");
             float norm = normItem->data.F32; // Normalisation
Index: /branches/eam_branches/ipp-20120601/psphot/src/psphot.h
===================================================================
--- /branches/eam_branches/ipp-20120601/psphot/src/psphot.h	(revision 34059)
+++ /branches/eam_branches/ipp-20120601/psphot/src/psphot.h	(revision 34060)
@@ -487,3 +487,16 @@
 bool psphotSetNFramesReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index);
 
+bool psphotGenerateModelVariance (pmConfig *config, const pmFPAview *view, pmFPAfile *file, int index, psMetadata *recipe, pmReadout *readout, psArray *sources);
+pmSourceFitVarMode psphotGetFitVarMode (psMetadata *recipe);
+bool psphotFreeModelVariance (pmReadout *readout, psArray *sources);
+
+bool psphotModelBackgroundReadout(psImage *model,  // Model image
+				  psImage *modelStdev, // Model stdev image
+				  psMetadata *analysis, // Analysis metadata for outputs
+				  pmReadout *readout, // Readout for which to generate a background model
+				  psImageBinning *binning, // Binning parameters
+				  const pmConfig *config,// Configuration
+				  bool useVarianceImage
+    );
+
 #endif
Index: /branches/eam_branches/ipp-20120601/psphot/src/psphotFitSourcesLinear.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psphot/src/psphotFitSourcesLinear.c	(revision 34059)
+++ /branches/eam_branches/ipp-20120601/psphot/src/psphotFitSourcesLinear.c	(revision 34060)
@@ -11,8 +11,4 @@
 
 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal);
-
-bool psphotGenerateModelVariance (pmConfig *config, const pmFPAview *view, pmFPAfile *file, int index, psMetadata *recipe, pmReadout *readout, psArray *sources);
-pmSourceFitVarMode psphotGetFitVarMode (psMetadata *recipe);
-bool psphotFreeModelVariance (pmReadout *readout, psArray *sources);
 
 // for now, let's store the detections on the readout->analysis for each readout
Index: /branches/eam_branches/ipp-20120601/psphot/src/psphotMaskReadout.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psphot/src/psphotMaskReadout.c	(revision 34059)
+++ /branches/eam_branches/ipp-20120601/psphot/src/psphotMaskReadout.c	(revision 34060)
@@ -135,6 +135,4 @@
 bool psphotUpdateVarianceReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe) {
 
-    bool status;
-
     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest
     psAssert (file, "missing file?");
