Index: /trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 13930)
+++ /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 13931)
@@ -94,9 +94,9 @@
 
 // Define an output pmFPAfile
-static pmFPAfile *fpaFileDefineOutput(const pmConfig *config, // Configuration
-                                      pmFPA *fpa, // Optional FPA to bind
-                                      const char *name, // Name of file rule
-                                      const char *cameraName, // Name of camera configuration to use
-                                      const char *formatName // Name of camera format to use
+pmFPAfile *pmFPAfileDefineOutputForFormat(const pmConfig *config, // Configuration
+					  pmFPA *fpa, // Optional FPA to bind
+					  const char *name, // Name of file rule
+					  const char *cameraName, // Name of camera configuration to use
+					  const char *formatName // Name of camera format to use
     )
 {
@@ -257,5 +257,5 @@
     PS_ASSERT_STRING_NON_EMPTY(name, NULL);
 
-    return fpaFileDefineOutput(config, fpa, name, NULL, NULL);
+    return pmFPAfileDefineOutputForFormat(config, fpa, name, NULL, NULL);
 }
 
@@ -472,19 +472,4 @@
     }
 
-// XXX this hack should now not be needed: the PSF is stored in a MEF fits table file
-# if (0)
-    // XXX temporary hack : force PSF input onto filename
-    // XXX EAM : I need to define a PSF container which specifies the chip/cell element
-    // XXX we could use the flat metadata style IF we restrict it to SIMPLE cameras
-    // XXX (ie, one readout per cell, one cell per chip, one chip per fpa)
-    if (file->type == PM_FPA_FILE_PSF) {
-        file->filerule = psStringCopy (infiles->data[0]);
-        if (found) {
-            *found = true;
-        }
-        return file;
-    }
-# endif
-
     // set derived values
     file->fileLevel = input->fileLevel;
@@ -979,5 +964,5 @@
         strcmp(config->cameraName + strlen(config->cameraName) - 8, "-SKYCELL") == 0) {
         // The input camera is already a skycell
-        file = fpaFileDefineOutput(config, fpa, filename, config->cameraName, "SKYCELL");
+        file = pmFPAfileDefineOutputForFormat(config, fpa, filename, config->cameraName, "SKYCELL");
     } else {
         psString cameraName = NULL;         // Name of the old camera configuration
@@ -993,7 +978,11 @@
         psString newCameraName = NULL;  // Name of the new (automatically-generated) camera configuration
         psStringAppend(&newCameraName, "_%s-SKYCELL", cameraName);
-        file = fpaFileDefineOutput(config, fpa, filename, newCameraName, "SKYCELL");
+        file = pmFPAfileDefineOutputForFormat(config, fpa, filename, newCameraName, "SKYCELL");
         psFree(cameraName);
         psFree(newCameraName);
+    }
+    if (!file) {
+        psErrorStackPrint(stderr, "file %s not defined\n", filename);
+        return NULL;
     }
 
@@ -1018,5 +1007,5 @@
         strcmp(config->cameraName + strlen(config->cameraName) - 5, "-CHIP") == 0) {
         // The input camera has already been mosaicked to this level
-        file = fpaFileDefineOutput(config, NULL, filename, config->cameraName, config->formatName);
+        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, config->cameraName, config->formatName);
     } else {
         psString cameraName = NULL;         // Name of the new (automatically-generated) camera configuration
@@ -1024,6 +1013,10 @@
 
         // Find the correct camera configuration
-        file = fpaFileDefineOutput(config, NULL, filename, cameraName, config->formatName);
+        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, cameraName, config->formatName);
         psFree(cameraName);
+    }
+    if (!file) {
+        psErrorStackPrint(stderr, "file %s not defined\n", filename);
+        return NULL;
     }
 
@@ -1046,5 +1039,5 @@
             strcmp(config->cameraName + strlen(config->cameraName) - 4 , "-FPA") == 0) {
         // The input camera has already been mosaicked to this level
-        file = fpaFileDefineOutput(config, NULL, filename, config->cameraName, config->formatName);
+        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, config->cameraName, config->formatName);
     } else {
 
@@ -1061,6 +1054,10 @@
         psFree(original);
 
-        file = fpaFileDefineOutput(config, NULL, filename, cameraName, config->formatName);
+        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, cameraName, config->formatName);
         psFree(cameraName);
+    }
+    if (!file) {
+        psErrorStackPrint(stderr, "file %s not defined\n", filename);
+        return NULL;
     }
 
Index: /trunk/psModules/src/camera/pmFPAfileDefine.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileDefine.h	(revision 13930)
+++ /trunk/psModules/src/camera/pmFPAfileDefine.h	(revision 13931)
@@ -4,6 +4,6 @@
  * @author EAM, IfA
  *
- * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-06-08 00:31:50 $
+ * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-06-21 22:45:27 $
  * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
  */
@@ -26,5 +26,16 @@
 // Note that the returned pmFPAfile is a view only, so it should not be freed by the caller --- the only
 // reference count is held by the config->files metadata.
-pmFPAfile *pmFPAfileDefineOutput (const pmConfig *config, pmFPA *fpa, const char *name);
+// Define an output pmFPAfile
+pmFPAfile *pmFPAfileDefineOutput(const pmConfig *config, // Configuration
+				 pmFPA *fpa, // Optional FPA to bind
+				 const char *name // Name of camera format to use
+    );
+
+pmFPAfile *pmFPAfileDefineOutputForFormat(const pmConfig *config, // Configuration
+					  pmFPA *fpa, // Optional FPA to bind
+					  const char *name, // Name of file rule
+					  const char *cameraName, // Name of camera configuration to use
+					  const char *formatName // Name of camera format to use
+    );
 
 // look for the given argname on the argument list.  find the give filename from the file rules
