Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 6753)
+++ trunk/psphot/src/psphotReadout.c	(revision 6851)
@@ -9,11 +9,14 @@
     bool         status;
 
+    // select the current recipe
+    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
+
     // find the currently selected readout
-    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
-    pmFPAfile  *input   = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
-    pmReadout  *readout = pmFPAviewThisReadout (view, input->fpa);
+    pmReadout  *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT");
 
     // XXX does this need to invoke I/O?
+    // XXX move this input the psphotImageLoop level?
     pmReadoutSetWeights (readout);
+    psphotSaveImage (NULL, readout->weight, "weight.fits");
 
     // I have a valid mask, now mask in the analysis region of interest
@@ -49,4 +52,6 @@
     psphotBlendFit (readout, sources, recipe, psf);
 
+    // psphotWeightBias (readout, sources, recipe, psf);
+
     // replace fitted sources
     psphotReplaceUnfit (sources);
@@ -75,4 +80,8 @@
     status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
 
+    // remove internal pmFPAfiles, if created
+    pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
+    pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
+
     // free up the local copies of the data
     psFree (psf);
