Index: trunk/psphot/src/psphotReadoutMinimal.c
===================================================================
--- trunk/psphot/src/psphotReadoutMinimal.c	(revision 28013)
+++ trunk/psphot/src/psphotReadoutMinimal.c	(revision 29936)
@@ -7,5 +7,5 @@
 // NOTE: ppSub needs to perform extended source analysis for comets and trails.
 
-bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view) {
+bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule) {
 
     // measure the total elapsed time in psphotReadout.  XXX the current threading plan
@@ -18,5 +18,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;
@@ -24,63 +24,63 @@
 
     // Generate the mask and weight images, including the user-defined analysis region of interest
-    psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
+    psphotSetMaskAndVariance (config, view, filerule);
 
     // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved on readout->analysis
-    if (!psphotLoadPSF (config, view)) {
+    if (!psphotLoadPSF (config, view, filerule)) {
       psError (PSPHOT_ERR_CONFIG, false, "missing psf model");
-      return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+      return psphotReadoutCleanup (config, view, filerule);
     }
 
     // find the detections (by peak and/or footprint) in the image. (final pass)
-    if (!psphotFindDetections(config, view, "PSPHOT.INPUT", false)) {
+    if (!psphotFindDetections(config, view, filerule, false)) {
         psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // construct sources and measure basic stats (saved on detections->newSources)
-    if (!psphotSourceStats (config, view, "PSPHOT.INPUT", false)) { // pass 1
+    if (!psphotSourceStats (config, view, filerule, false)) { // pass 1
         psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // find blended neighbors of very saturated stars
-    psphotDeblendSatstars (config, view, "PSPHOT.INPUT");
+    psphotDeblendSatstars (config, view, filerule);
 
     // mark blended peaks PS_SOURCE_BLEND
-    if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {
+    if (!psphotBasicDeblend (config, view, filerule)) {
         psLogMsg ("psphot", 3, "failed on deblend analysis");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // classify sources based on moments, brightness (use supplied psf shape parameters)
-    if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
+    if (!psphotRoughClass (config, view, filerule)) {
         psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
-        return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
+        return psphotReadoutCleanup (config, view, filerule);
     }
 
     // construct an initial model for each object
-    psphotGuessModels (config, view, "PSPHOT.INPUT");
+    psphotGuessModels (config, view, filerule);
 
     // merge the newly selected sources into the existing list
-    psphotMergeSources (config, view, "PSPHOT.INPUT");
+    psphotMergeSources (config, view, filerule);
 
     // linear PSF fit to source peaks
-    psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
+    psphotFitSourcesLinear (config, view, filerule, false);
 
 // XXX eventually, add the extended source fits here
 # if (0)
     // measure source size for the remaining sources
-    psphotSourceSize (config, view, "PSPHOT.INPUT");
+    psphotSourceSize (config, view, filerule);
 
-    psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT");
+    psphotExtendedSourceAnalysis (config, view, filerule);
 
-    psphotExtendedSourceFits (config, view, "PSPHOT.INPUT");
+    psphotExtendedSourceFits (config, view, filerule);
 # endif
 
     // calculate source magnitudes
-    psphotMagnitudes(config, view, "PSPHOT.INPUT");
+    psphotMagnitudes(config, view, filerule);
 
     // XXX ensure this is measured if the analysis succeeds (even if quality is low)
-    if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) {
+    if (!psphotEfficiency(config, view, filerule)) {
         psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
         psErrorClear();
@@ -88,7 +88,7 @@
 
     // 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);
 }
