Index: trunk/psphot/src/psphotMakePSFReadout.c
===================================================================
--- trunk/psphot/src/psphotMakePSFReadout.c	(revision 28013)
+++ trunk/psphot/src/psphotMakePSFReadout.c	(revision 29936)
@@ -1,5 +1,5 @@
 # include "psphotInternal.h"
 
-bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view) {
+bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
 
     // measure the total elapsed time in psphotReadout.  XXX the current threading plan
@@ -19,5 +19,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;
@@ -29,21 +29,21 @@
 
     // 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);
     }
 
-    psphotLoadExtSources (config, view, "PSPHOT.INPUT");
+    psphotLoadExtSources (config, view, filerule);
 
     // If sources have been supplied, then these should be used to measure the PSF include
@@ -53,24 +53,24 @@
     // a text file have no valid SN values, but psphotChoosePSF needs to select the top
     // PSF_MAX_NSTARS to generate the PSF.
-    if (!psphotCheckExtSources (config, view, "PSPHOT.INPUT")) {
+    if (!psphotCheckExtSources (config, view, filerule)) {
 	psLogMsg ("psphot", 3, "failure to select possible PSF sources (external or internal)");
-	return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+	return psphotReadoutCleanup (config, view, filerule);
     }
 
     // Use bright stellar objects to measure PSF. If we do not have enough stars to generate
     // the PSF, build one from the SEEING guess and model class
-    if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {
+    if (!psphotChoosePSF (config, view, filerule)) {
 	psLogMsg ("psphot", 3, "failure to construct a psf model");
-	return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+	return psphotReadoutCleanup (config, view, filerule);
     }
 
     // measure aperture photometry corrections
 # if 0
-    if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
+    if (!psphotApResid (config, view, filerule)) {
         psLogMsg ("psphot", 3, "failed on psphotApResid");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 # endif
 
-    return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+    return psphotReadoutCleanup (config, view, filerule);
 }
