Index: trunk/psphot/src/psphotModelBackground.c
===================================================================
--- trunk/psphot/src/psphotModelBackground.c	(revision 28013)
+++ trunk/psphot/src/psphotModelBackground.c	(revision 29936)
@@ -383,16 +383,12 @@
 }
 
-// XXX supply filename or keep PSPHOT.INPUT fixed?
 bool psphotModelBackground (pmConfig *config, const pmFPAview *view, const char *filerule)
 {
-    bool status = false;
-
-    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
+    int num = psphotFileruleCount(config, filerule);
 
     // loop over the available readouts
     for (int i = 0; i < num; i++) {
         if (!psphotModelBackgroundReadoutFileIndex(config, view, filerule, i)) {
-            psError (PSPHOT_ERR_CONFIG, false, "failed to model background for PSPHOT.INPUT entry %d", i);
+	    psError (PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", filerule, i);
             return false;
         }
