Index: trunk/psphot/src/psphotForcedReadout.c
===================================================================
--- trunk/psphot/src/psphotForcedReadout.c	(revision 28013)
+++ trunk/psphot/src/psphotForcedReadout.c	(revision 29936)
@@ -1,5 +1,5 @@
 # include "psphotInternal.h"
 
-bool psphotForcedReadout(pmConfig *config, const pmFPAview *view) {
+bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
 
     // measure the total elapsed time in psphotReadout.  XXX the current threading plan
@@ -20,5 +20,5 @@
 
     // set the photcode for this image
-    if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {
+    if (!psphotAddPhotcode (config, view, filerule)) {
         psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
         return false;
@@ -30,38 +30,38 @@
 
     // Generate the mask and weight images, including the user-defined analysis region of interest
-    psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
+    psphotSetMaskAndVariance (config, view, filerule);
     if (!strcasecmp (breakPt, "NOTHING")) {
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // generate a background model (median, smoothed image)
-    if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+    if (!psphotModelBackground (config, view, filerule)) {
+        return psphotReadoutCleanup (config, view, filerule);
     }
-    if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+    if (!psphotSubtractBackground (config, view, filerule)) {
+        return psphotReadoutCleanup (config, view, filerule);
     }
     if (!strcasecmp (breakPt, "BACKMDL")) {
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
-    if (!psphotLoadPSF (config, view)) {
+    if (!psphotLoadPSF (config, view, filerule)) {
     	// this only happens if we had a programming error in psphotLoadPSF
         psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // include externally-supplied sources
-    psphotLoadExtSources (config, view, "PSPHOT.INPUT");
+    psphotLoadExtSources (config, view, filerule);
 
     // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
-    psphotGuessModels (config, view, "PSPHOT.INPUT");
+    psphotGuessModels (config, view, filerule);
 
     // merge the newly selected sources into the existing list
     // NOTE: merge OLD and NEW
-    psphotMergeSources (config, view, "PSPHOT.INPUT");
+    psphotMergeSources (config, view, filerule);
 
     // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
-    psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
+    psphotFitSourcesLinear (config, view, filerule, false);
 
     // identify CRs and extended sources
@@ -71,5 +71,5 @@
 
     // calculate source magnitudes
-    psphotMagnitudes(config, view, "PSPHOT.INPUT");
+    psphotMagnitudes(config, view, filerule);
 
     // XXX do I want to do this?
@@ -80,10 +80,10 @@
 
     // replace background in residual image
-    psphotSkyReplace (config, view, "PSPHOT.INPUT");
+    psphotSkyReplace (config, view, filerule);
 
     // drop the references to the image pixels held by each source
-    psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
+    psphotSourceFreePixels (config, view, filerule);
 
     // create the exported-metadata and free local data
-    return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+    return psphotReadoutCleanup (config, view, filerule);
 }
