Index: trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 13496)
+++ trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 13525)
@@ -225,5 +225,5 @@
 // save the pmFPAfile on config->files
 // return the pmFPAfile (a view to the one saved on config->files)
-pmFPAfile *pmFPAfileDefineFromArgs(bool *found, pmConfig *config, const char *filename, const char *argname)
+pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -238,10 +238,11 @@
     psMetadata *format = NULL;
 
-    if (found && *found)
-        return NULL;
+    // use success to identify valid exit conditions (as opposed to 'argument not supplied')
+    if (success) *success = false;
 
     // we search the argument data for the named fileset (argname)
     psArray *infiles = psMetadataLookupPtr(&status, config->arguments, argname);
     if (!status) {
+	if (success) *success = true;
         return NULL;
     }
@@ -383,6 +384,6 @@
     }
     psFree (fpa);
-    if (found)
-        *found = true;
+    if (success) *success = true;
+
     return file;
 }
@@ -394,5 +395,5 @@
 // save the pmFPAfile on config->files
 // return the pmFPAfile (a view to the one saved on config->files)
-pmFPAfile *pmFPAfileBindFromArgs (bool *found, pmFPAfile *input, const pmConfig *config, const char *filename, const char *argname)
+pmFPAfile *pmFPAfileBindFromArgs (bool *success, pmFPAfile *input, const pmConfig *config, const char *filename, const char *argname)
 {
     PS_ASSERT_PTR_NON_NULL(input, NULL);
@@ -406,6 +407,6 @@
     psMetadata *phu = NULL;
 
-    if (found && *found)
-        return NULL;
+    // use success to identify valid exit conditions (as opposed to 'argument not supplied')
+    if (success) *success = false;
 
     // we search the argument data for the named fileset (argname)
@@ -413,4 +414,5 @@
     if (!status) {
         // this is not an error: this just means no matching argument was supplied
+	if (success) *success = true;
         return NULL;
     }
@@ -428,4 +430,7 @@
         return NULL;
     }
+
+// 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
@@ -439,4 +444,5 @@
         return file;
     }
+# endif
 
     // set derived values
@@ -508,6 +514,5 @@
         psFree (phu);
     }
-    if (found)
-        *found = true;
+    if (success) *success = true;
     return file;
 }
@@ -519,5 +524,5 @@
 // save the pmFPAfiles on config->files
 // return the pmFPAfiles (a view to the one saved on config->files)
-pmFPAfile *pmFPAfileDefineSingleFromArgs (bool *found, pmConfig *config, const char *filename,
+pmFPAfile *pmFPAfileDefineSingleFromArgs (bool *success, pmConfig *config, const char *filename,
         const char *argname, int entry)
 {
@@ -533,6 +538,5 @@
     psMetadata *format = NULL;
 
-    if (found && *found)
-        return NULL;
+    if (success) *success = false;
 
     // we search the argument data for the named fileset (argname)
@@ -540,4 +544,5 @@
     if (!status) {
         psTrace("psModules.camera", 5, "Failed to find %s in argument list", argname);
+	if (success) *success = true;
         return NULL;
     }
@@ -625,6 +630,5 @@
     psFree(format);
 
-    if (found)
-        *found = true;
+    if (success) *success = true;
     return file;
 }
@@ -632,11 +636,10 @@
 // define the named pmFPAfile from the camera->config
 // only valid for pmFPAfile->mode = READ
-pmFPAfile *pmFPAfileDefineFromConf (bool *found, const pmConfig *config, const char *filename)
+pmFPAfile *pmFPAfileDefineFromConf (bool *success, const pmConfig *config, const char *filename)
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
     PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
 
-    if (found && *found)
-        return NULL;
+    if (success) *success = false;
 
     // a camera config is needed (as source of file rule)
@@ -675,4 +678,5 @@
         // don't free the file here: it is left on config->files
         // to be used optionally by pmFPAfileDefineFromDetDB (or others)
+	if (success) *success = true;
         return NULL;
     }
@@ -684,6 +688,6 @@
     file->filerule = tmpName;
 
-    if (found)
-        *found = true;
+    if (success) *success = true;
+
     return file;
 }
@@ -694,5 +698,5 @@
 // save the pmFPAfile on config->files
 // return the pmFPAfile (a view to the one saved on config->files)
-pmFPAfile *pmFPAfileDefineFromDetDB (bool *found, const pmConfig *config, const char *filename,
+pmFPAfile *pmFPAfileDefineFromDetDB (bool *success, const pmConfig *config, const char *filename,
                                      pmFPA *input, pmDetrendType type)
 {
@@ -707,6 +711,5 @@
     pmFPAfile *file = NULL;
 
-    if (found && *found)
-        return NULL;
+    if (success) *success = false;
 
     // a camera config is needed (as source of file rule)
@@ -843,7 +846,5 @@
     psFree (options);
 
-    if (found) {
-        *found = true;
-    }
+    if (success) *success = false;
     return file;
 }
