Index: branches/tap_branches/ppSim/src/ppSimPhotomReadoutFake.c
===================================================================
--- branches/tap_branches/ppSim/src/ppSimPhotomReadoutFake.c	(revision 25900)
+++ branches/tap_branches/ppSim/src/ppSimPhotomReadoutFake.c	(revision 27838)
@@ -1,4 +1,6 @@
 # include "ppSim.h"
 
+// XXX this function is currently disabled -- need to update code below to distinguish the fake
+// and force positions, etc
 bool ppSimPhotomReadoutFake(pmConfig *config, const pmFPAview *view) {
 
@@ -11,12 +13,4 @@
         return false;
     }
-
-# if 0
-    // set the photcode for this image
-    if (!psphotAddPhotcode (recipe, config, view, "PPSIM.FAKE.CHIP")) {
-        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
-        return false;
-    }
-# endif
 
     // *** in this section, perform the photometry for real + fake sources on PPSIM.FAKE.CHIP ***
@@ -36,5 +30,5 @@
 
     // Generate the mask and variance images, including the user-defined analysis region of interest
-    psphotSetMaskAndVariance (config, readout, recipe);
+    psphotSetMaskAndVariance (config, view);
 
     // XXX need to define the source pixels
@@ -58,6 +52,5 @@
     // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved in the recipe
     // this function uses PSPHOT.PSF.LOAD as the pmFPAfile
-    pmPSF *psf = psphotLoadPSF (config, view, recipe);
-    assert (psf);
+    psphotLoadPSF (config, view);
 
     // remove all sources
@@ -65,8 +58,8 @@
 
     // generate a background model (median, smoothed image)
-    if (!psphotModelBackground (config, view, "PPSIM.FAKE.CHIP")) {
+    if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.FAKE.CHIP", 0)) {
         return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
     }
-    if (!psphotSubtractBackground (config, view, "PPSIM.FAKE.CHIP")) {
+    if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.FAKE.CHIP", 0, recipe)) {
         return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
     }
@@ -118,5 +111,10 @@
     psAssert (fakeReadout, "no fakeReadout?");
     pmChipSetDataStatus (fakeChip, true);
-    psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "fake photometry ", fakeSources);
+
+    pmDetections *detections = pmDetectionsAlloc();
+    detection->allSources = fakeSources;
+
+    psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE, "fake photometry ", detections);
+    psFree(detections);
 
     return true;
