Index: trunk/psphot/src/psphotStackChisqImage.c
===================================================================
--- trunk/psphot/src/psphotStackChisqImage.c	(revision 28013)
+++ trunk/psphot/src/psphotStackChisqImage.c	(revision 29936)
@@ -8,6 +8,4 @@
 bool psphotStackChisqImage (pmConfig *config, const pmFPAview *view, const char *ruleDet, const char *ruleCnv)
 {
-    bool status = false;
-
     psTimerStart ("psphot.chisq.image");
 
@@ -17,6 +15,5 @@
     pmReadout *chiReadout = NULL;
 
-    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
+    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
 
     // loop over the available readouts
@@ -28,7 +25,4 @@
         }
     }
-
-    num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
 
     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.CHISQ.NUM", PS_META_REPLACE, "", num);
@@ -125,6 +119,5 @@
     psAssert (status, "programming error: must define PSPHOT.CHISQ.NUM");
 
-    int inputNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
+    int inputNum = psphotFileruleCount(config, "PSPHOT.INPUT");
 
     pmFPAfileRemoveSingle (config->files, filerule, chisqNum);
