Index: trunk/pswarp/src/pswarpLoop.c
===================================================================
--- trunk/pswarp/src/pswarpLoop.c	(revision 20348)
+++ trunk/pswarp/src/pswarpLoop.c	(revision 21178)
@@ -3,24 +3,11 @@
 
 #define WCS_NONLIN_TOL 0.001            // Non-linear tolerance for header WCS
-#define PSPHOT_FIND_PSF 0               // Use psphot's findPSF function?
-//#define TESTING 1                       // Testing output?
-
-// Lists of file rules for the detectors and skycells, and an independent list of everything else
-// Lists must end with a NULL
-static char *detectorFiles[] = { "PSWARP.INPUT", "PSWARP.MASK", "PSWARP.WEIGHT", NULL };
-static char *skycellFiles[] = { "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.WEIGHT", NULL };
-static char *photFiles[] = { "PSPHOT.INPUT", "PSPHOT.OUTPUT",
-#if PSPHOT_FIND_PSF
-                             "PSPHOT.INPUT.CMF",
-#endif
-                             "PSPHOT.RESID",
-                             "PSPHOT.BACKMDL", "PSPHOT.BACKMDL.STDEV", "PSPHOT.BACKGND", "PSPHOT.BACKSUB",
-                             "PSPHOT.PSF.SAVE", "SOURCE.PLOT.MOMENTS", "SOURCE.PLOT.PSFMODEL",
-                             "SOURCE.PLOT.APRESID", NULL };
-static char *independentFiles[] = { "PSWARP.ASTROM", // Read independently from the input pixels
-                                    "PSWARP.SKYCELL", // Don't care about the skycell once we have its WCS
-                                    "PSWARP.OUTPUT.SOURCES", // Save these independently so we can do the PSF
-                                    NULL };
-
+#define PSPHOT_FIND_PSF 1               // Use psphot's findPSF function?
+#define TESTING 0                       // Testing output?
+
+// Lists of file rules used at different stages
+#include "pswarpFileNames.h"
+
+// XXX these are generic functions which should be moved to psModules
 // Activate a list of files
 static void fileActivation(pmConfig *config, // Configuration
@@ -141,4 +128,5 @@
 
     // Read the input astrometry
+    // XXX rather than use the activations here, this should just explicitly loop over the desired filerule
     {
         pmFPAfileActivate(config->files, true, "PSWARP.ASTROM");
@@ -386,5 +374,5 @@
 #endif
 
-#ifdef TESTING
+#if (TESTING)
         {
             #define PSF_SIZE 20         // Half-size of PSF
