Index: /trunk/psModules/src/astrom/pmAstrometryUtils.c
===================================================================
--- /trunk/psModules/src/astrom/pmAstrometryUtils.c	(revision 35560)
+++ /trunk/psModules/src/astrom/pmAstrometryUtils.c	(revision 35561)
@@ -23,4 +23,7 @@
 #include "pmAstrometryUtils.h"
 
+// this is used by the test output block
+static int Nout = 0;
+
 // given a 2D transformation -- L(x,y),M(x,y) -- find the coordinates x,y
 // for which L,M = 0,0. tol is the allowed error on x,y.
@@ -33,4 +36,20 @@
     double Xo = (trans->y->coeff[0][0]*trans->x->coeff[0][1] - trans->x->coeff[0][0]*trans->y->coeff[0][1])/R;
     double Yo = (trans->x->coeff[0][0]*trans->y->coeff[1][0] - trans->y->coeff[0][0]*trans->x->coeff[1][0])/R;
+
+    if (0) {
+      // this is a test output block, not used in normal operations
+      char filename[64];
+      snprintf (filename, 64, "trans.%03d.md", Nout);
+      FILE *f = fopen (filename, "w");
+
+      psMetadata *md = psMetadataAlloc();
+
+      psPolynomial2DtoMetadata (md, trans->x, "X");
+      psPolynomial2DtoMetadata (md, trans->y, "Y");
+      psMetadataConfigPrint (f, md);
+      psFree (md);
+      fclose (f);
+      Nout ++;
+    }
 
     // iterate to actual solution: requires small non-linear terms
@@ -52,11 +71,13 @@
         for (int i = 0; (dPos > tol) && (i < 20); i++) {
             // NOTE: order for Alpha is: [y][x]
+            // original Alpha->data.F32[1][0] = psPolynomial2DEval (XdY, Xo, Yo);
+            // original Alpha->data.F32[0][1] = psPolynomial2DEval (YdX, Xo, Yo);
             Alpha->data.F32[0][0] = psPolynomial2DEval (XdX, Xo, Yo);
-            Alpha->data.F32[1][0] = psPolynomial2DEval (XdY, Xo, Yo);
-            Alpha->data.F32[0][1] = psPolynomial2DEval (YdX, Xo, Yo);
+            Alpha->data.F32[0][1] = psPolynomial2DEval (XdY, Xo, Yo);
+            Alpha->data.F32[1][0] = psPolynomial2DEval (YdX, Xo, Yo);
             Alpha->data.F32[1][1] = psPolynomial2DEval (YdY, Xo, Yo);
 
-            Beta->data.F32[0] = psPolynomial2DEval (trans->x, Xo, Yo);
-            Beta->data.F32[1] = psPolynomial2DEval (trans->y, Xo, Yo);
+            Beta->data.F32[0] = -1.0 * psPolynomial2DEval (trans->x, Xo, Yo);
+            Beta->data.F32[1] = -1.0 * psPolynomial2DEval (trans->y, Xo, Yo);
 
             if (!psMatrixGJSolve (Alpha, Beta)) {
@@ -71,8 +92,8 @@
 	    }
 
-            Xo -= Beta->data.F32[0];
-            Yo -= Beta->data.F32[1];
+            Xo += Beta->data.F32[0];
+            Yo += Beta->data.F32[1];
             dPos = hypot(Beta->data.F32[0], Beta->data.F32[1]);
-
+	    psTrace ("psastro", 5, "i: %d, Xo,Yo : %f %f  dX, dY: %f %f dPos: %f\n", i, Xo, Yo, Beta->data.F32[0], Beta->data.F32[1], dPos);
         }
         psFree (Alpha);
Index: /trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 35561)
@@ -110,10 +110,20 @@
     assert(hdu);
 
+    // XXXX here is the issue : we need to avoid raising an error here
     if (fpa->hdu) {
         // Something's already here
         if (fpa->hdu != hdu) {
-            psError(PS_ERR_IO, true, "Unable to add HDU since FPA already has one.\n");
-        }
-        return false;
+# define TEST1 1
+# if (TEST1)
+	    psError(PS_ERR_IO, true, "Unable to add HDU since FPA already has one.\n");
+# else
+	    psWarning ("Unable to add HDU since FPA already has one.\n");
+# endif
+        }
+# if (TEST1)
+        return false;
+# else
+        return true;
+# endif
     }
     fpa->hdu = psMemIncrRefCounter(hdu);
@@ -1154,7 +1164,11 @@
               phdu->blankPHU = true;
               if (install) {
-                  if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_CHIP(fpa, format) ||
-                      !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU,
-                                         true, NULL)) {
+		  if (!addHDUtoFPA(fpa, phdu)) {
+		      psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+		  }		  
+                  if (!addSource_FPA_CHIP(fpa, format)) {
                       psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
                       psFree(phdu);
@@ -1162,14 +1176,30 @@
                       return NULL;
                   }
-              }
+                  if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) {
+                      psError(PS_ERR_UNKNOWN, false, "Unable to read concepts.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+                  }
+	      }
               psFree(phdu);
               return view;
             case PM_FPA_LEVEL_CELL:
+	      phdu->blankPHU = true;
               if (install) {
-                  phdu->blankPHU = true;
-                  if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_CELL(fpa, format) ||
-                      !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU,
-                                         true, NULL)) {
+                  if (!addHDUtoFPA(fpa, phdu)) {
+                      psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+                  }
+                  if (!addSource_FPA_CELL(fpa, format)) {
                       psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+                  }
+                  if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) {
+                      psError(PS_ERR_UNKNOWN, false, "Unable to read concepts.");
                       psFree(phdu);
                       psFree(view);
@@ -1180,10 +1210,20 @@
               return view;
             case PM_FPA_LEVEL_NONE:
+	      phdu->blankPHU = false;
               if (install) {
-                  phdu->blankPHU = false;
-                  if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_NONE(fpa, format) ||
-                      !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU,
-                                         true, NULL)) {
+                  if (!addHDUtoFPA(fpa, phdu)) {
+                      psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+                  }
+                  if (!addSource_FPA_NONE(fpa, format)) {
                       psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
+                      psFree(phdu);
+                      psFree(view);
+                      return NULL;
+                  }
+                  if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) {
+                      psError(PS_ERR_UNKNOWN, false, "Unable to read concepts.");
                       psFree(phdu);
                       psFree(view);
Index: /trunk/psModules/src/camera/pmFPACopy.c
===================================================================
--- /trunk/psModules/src/camera/pmFPACopy.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPACopy.c	(revision 35561)
@@ -480,4 +480,8 @@
             pmCell *sourceCell = sourceCells->data[cellNum]; // The source cell
             status &= cellCopy(targetCell, sourceCell, pixels, xBin, yBin);
+	    // update the attributes
+	    targetCell->file_exists = sourceCell->file_exists;
+	    targetCell->data_exists = sourceCell->data_exists;
+	    targetCell->process     = sourceCell->process;
         }
     }
@@ -489,4 +493,10 @@
     psMetadataItem *chipName = psMemIncrRefCounter(psMetadataLookup(target->concepts, "CHIP.NAME"));
     pmConceptsCopyChip(target, source, false);
+
+    // update the attributes
+    target->file_exists = source->file_exists;
+    target->data_exists = source->data_exists;
+    target->process     = source->process;
+
     psMetadataAddItem(target->concepts, chipName, PS_LIST_TAIL, PS_META_REPLACE);
     psFree(chipName);
Index: /trunk/psModules/src/camera/pmFPAFlags.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAFlags.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAFlags.c	(revision 35561)
@@ -379,4 +379,25 @@
             }
         }
+    }
+    return true;
+}
+
+
+// XXX this function should probably be re-defined to merge with 'setCellsProcess'
+bool pmChipSelectCells(pmChip *chip)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+
+    psArray *cells = chip->cells;       // Component cells
+    if (!cells) {
+        return false;
+    }
+
+    for (int i = 0; i < cells->n; i++) {
+        pmCell *cell = cells->data[i];
+        if (!cell) {
+            continue;
+        }
+	cell->process = true;
     }
     return true;
@@ -415,4 +436,26 @@
 
 
+// turn off all chips
+bool pmFPAExcludeChips(pmFPA *fpa)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    psArray *chips = fpa->chips;        // Component chips
+    if (chips == NULL) {
+        psWarning("WARNING: fpa->chips == NULL\n");
+        return false;
+    }
+
+    for (int i = 0 ; i < chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) chips->data[i]; // Chip of interest
+        if (tmpChip != NULL) {
+	  tmpChip->process = false;
+	  setCellsProcess(tmpChip, false); // Wipe out the cell as well
+        }
+    }
+
+    return true;
+}
+
 int pmChipExcludeCell(pmChip *chip, int cellNum)
 {
Index: /trunk/psModules/src/camera/pmFPAFlags.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAFlags.h	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAFlags.h	(revision 35561)
@@ -122,4 +122,10 @@
                     );
 
+/// Exclude all chips within an FPA from processing
+bool pmFPAExcludeChips(pmFPA *fpa        ///< FPA containing the chip of interest
+                    );
+
+bool pmChipSelectCells(pmChip *chip);
+
 /// Exclude a cell within a chip from processing
 int pmChipExcludeCell(pmChip *chip,     ///< Chip containing the chip of interest
Index: /trunk/psModules/src/camera/pmFPAMaskWeight.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 35561)
@@ -301,6 +301,8 @@
     psRegion *trimsec = psMetadataLookupPtr(&mdok, cell->concepts, "CELL.TRIMSEC"); // Trim section
     if (!mdok || psRegionIsNaN(*trimsec)) {
-        psError(PS_ERR_IO, true, "CELL.TRIMSEC is not set --- unable to set variance.\n");
-        return false;
+      // if trimsec is not defined, use the full image
+      trimsec = psRegionAlloc(0,0,0,0);
+      // psError(PS_ERR_IO, true, "CELL.TRIMSEC is not set --- unable to set variance.\n");
+      // return false;
     }
 
Index: /trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 35561)
@@ -446,7 +446,132 @@
 }
 
+// given a filename, convert to UNIX namespace and read the PHU 
+psMetadata *readPHUfromFilename (char *filename, pmConfig *config) {
+
+    // Need to generate an FPA
+    psString realName = pmConfigConvertFilename(filename, config, false, false);
+    if (!realName) {
+	psError(psErrorCodeLast(), false, "Failed to convert file name %s", filename);
+	return NULL;
+    }
+
+    // load the header of the first image
+    // EXTWORD (fits->extword) is not relevant to the PHU
+    psFits *fits = psFitsOpen(realName, "r"); // FITS file
+    if (!fits) {
+	psError(psErrorCodeLast(), false, "Failed to open file %s", realName);
+	psFree(realName);
+	return NULL;
+    }
+
+    psMetadata *phu = psFitsReadHeader (NULL, fits); // Primary header
+    if (!phu) {
+	psError(psErrorCodeLast(), false, "Failed to read file header %s", realName);
+	psFree(realName);
+	return NULL;
+    }
+
+    if (!psFitsClose(fits)) {
+	psError(psErrorCodeLast(), false, "Failed to close file %s", realName);
+	psFree(realName);
+	psFree(phu);
+	return NULL;
+    }
+
+    psFree(realName);
+    return phu;
+}
+
+// this this function wants to return:
+// pmFPA, PHU, fileLevel, outConfig
+// camera, cameraName, formatName
+typedef struct {
+    pmFPA *fpa;
+    psMetadata *phu;
+    psMetadata *format;
+    pmFPALevel fileLevel;
+    psString cameraName;
+    psString formatName;
+} pmFPAfromFilenameOutput;
+
+// for the given filename, read PHU and determine camera format; build an FPA for the file
+bool pmFPAfromFilename (pmFPAfromFilenameOutput *output, pmConfig **outConfig, pmConfig *sysConfig, char *filename){
+
+    // Need to generate an FPA
+    psMetadata *phu = readPHUfromFilename (filename, sysConfig);
+    if (!phu) {
+	psError(psErrorCodeLast(), false, "Failed to read PHU for %s", filename);
+	return false;
+    }
+
+    // if we expect the loaded FPA to differ in configuration from the current system configuration
+    // generate an output config for this FPA
+    pmConfig *config = NULL;
+    if (outConfig) {
+	config = pmConfigAlloc();
+	config->user = psMemIncrRefCounter(sysConfig->user);
+	config->system = psMemIncrRefCounter(sysConfig->system);
+
+	psFree (config->files);
+	config->files = psMemIncrRefCounter(sysConfig->files);
+	psFree (config->arguments);
+	config->arguments = psMemIncrRefCounter(sysConfig->arguments);
+
+	*outConfig = config;
+    } else {
+	config = sysConfig;
+    }
+
+    // values which are returned to calling function
+    psString formatName = NULL;	// Name of camera format
+    psString cameraName = NULL;	// Name of camera
+    psMetadata *camera = NULL;	// Camera configuration
+
+    // Determine the current format from the header; determine camera if not specified already.
+    psMetadata *format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true);
+    if (!format) {
+	psError(psErrorCodeLast(), false, "Failed to determine camera format for %s", filename);
+	psFree(camera);
+	psFree(formatName);
+	psFree(phu);
+	return false;
+    }
+
+    pmFPALevel fileLevel = pmFPAPHULevel(format);
+    if (fileLevel == PM_FPA_LEVEL_NONE) {
+	psError(PM_ERR_CONFIG, true, "Unable to determine file level for %s", filename);
+	psFree(camera);
+	psFree(formatName);
+	psFree(phu);
+	return false;
+    }
+
+    // build the template fpa, set up the basic view
+    // we supply the metaCamera name (if NULL, baseCamera name is used)
+    pmFPA *fpa = pmFPAConstruct(camera, cameraName);
+    psFree(camera);
+
+    if (!fpa) {
+	psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", filename);
+	psFree(formatName);
+	psFree(format);
+	psFree(phu);
+	return NULL;
+    }
+
+    output->fpa = fpa;
+    output->phu = phu;
+    output->format = format;
+    output->fileLevel = fileLevel;
+    output->cameraName = cameraName;
+    output->formatName = formatName;
+
+    return true;
+
+}
 
 /// Define a file from an array of filenames
-static pmFPAfile *fpaFileDefineFromArray(pmConfig *config, // Configuration
+static pmFPAfile *fpaFileDefineFromArray(pmConfig **outConfig, // output configuration
+					 pmConfig *sysConfig, // global configuration
                                          pmFPAfile *bind, // File to bind to, or NULL
                                          const char *name, // Name of file
@@ -454,5 +579,5 @@
     )
 {
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    PS_ASSERT_PTR_NON_NULL(sysConfig, NULL);
     PS_ASSERT_STRING_NON_EMPTY(name, NULL);
 
@@ -463,4 +588,5 @@
     pmFPALevel fileLevel = PM_FPA_LEVEL_NONE; // Level for files
     psMetadata *phu = NULL;             // Primary header
+
     if (bind) {
         // Use the FPA we're binding to
@@ -468,67 +594,17 @@
         fileLevel = bind->fileLevel;
     } else {
-        // Need to generate an FPA
-        psString realName = pmConfigConvertFilename(filenames->data[0], config, false, false);
-        if (!realName) {
-            psError(psErrorCodeLast(), false, "Failed to convert file name %s", (char *)filenames->data[0]);
-            return NULL;
-        }
-
-        // load the header of the first image
-        // EXTWORD (fits->extword) is not relevant to the PHU
-        psFits *fits = psFitsOpen(realName, "r"); // FITS file
-        if (!fits) {
-            psError(psErrorCodeLast(), false, "Failed to open file %s", realName);
-            psFree(realName);
-            return NULL;
-        }
-        phu = psFitsReadHeader (NULL, fits); // Primary header
-        if (!phu) {
-            psError(psErrorCodeLast(), false, "Failed to read file header %s", realName);
-            psFree(realName);
-            return NULL;
-        }
-        if (!psFitsClose(fits)) {
-            psError(psErrorCodeLast(), false, "Failed to close file %s", realName);
-            psFree(realName);
-            return NULL;
-        }
-
-        // Determine the current format from the header; determine camera if not specified already.
-        psMetadata *camera = NULL;      // Camera configuration
-        format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true);
-        if (!format) {
-            psError(psErrorCodeLast(), false, "Failed to determine camera format for %s", realName);
-            psFree(camera);
-            psFree(formatName);
-            psFree(realName);
-            psFree(phu);
-            return NULL;
-        }
-
-        fileLevel = pmFPAPHULevel(format);
-        if (fileLevel == PM_FPA_LEVEL_NONE) {
-            psError(PM_ERR_CONFIG, true, "Unable to determine file level for %s", realName);
-            psFree(camera);
-            psFree(formatName);
-            psFree(realName);
-            psFree(phu);
-            return NULL;
-        }
-
-        // build the template fpa, set up the basic view
-        // XXX do we want this to be the baseCamera name or the metaCamera name?
-        fpa = pmFPAConstruct(camera, cameraName);
-        psFree(camera);
-        if (!fpa) {
-            psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", realName);
-            psFree(formatName);
-            psFree(realName);
-            psFree(format);
-            psFree(phu);
-            return NULL;
-        }
-        psFree(realName);
-    }
+	pmFPAfromFilenameOutput output;
+	if (!pmFPAfromFilename (&output, outConfig, sysConfig, filenames->data[0])) {
+	    return NULL;
+	}
+	fpa = output.fpa;
+	phu = output.phu;
+	format = output.format;
+	fileLevel = output.fileLevel;
+	cameraName = output.cameraName;
+	formatName = output.formatName;
+    }
+
+    pmConfig *config = outConfig ? *outConfig : sysConfig;
 
     // load the given filerule (from config->camera) and bind it to the fpa
@@ -561,27 +637,9 @@
         // Check that the file corresponds to the same camera and format
         if (!phu) {
-            psString realName = pmConfigConvertFilename(filenames->data[i], config, false, false);
-            if (!realName) {
-                psError(psErrorCodeLast(), false, "Failed to convert file name %s", (char*)filenames->data[i]);
+	    phu = readPHUfromFilename (filenames->data[i], config);
+            if (!phu) {
+                psError(psErrorCodeLast(), false, "Failed to read PHU for %s", (char *)filenames->data[i]);
                 return NULL;
             }
-            psFits *fits = psFitsOpen(realName, "r"); // FITS file
-            if (!fits) {
-                psError(psErrorCodeLast(), false, "Failed to open file %s", realName);
-                psFree(realName);
-                return NULL;
-            }
-            phu = psFitsReadHeader(NULL, fits);
-            if (!psFitsClose(fits)) {
-                psError(psErrorCodeLast(), false, "Failed to close file %s", realName);
-                psFree(realName);
-                return NULL;
-            }
-            if (!phu) {
-                psError(psErrorCodeLast(), false, "Failed to read file header %s", realName);
-                psFree(realName);
-                return NULL;
-            }
-            psFree(realName);
         }
 
@@ -651,7 +709,6 @@
 }
 
-
-pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config,
-                                   const char *filename, const char *argname)
+// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
+pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -676,5 +733,5 @@
     }
 
-    pmFPAfile *file = fpaFileDefineFromArray(config, NULL, filename, filenames); // File of interest
+    pmFPAfile *file = fpaFileDefineFromArray(NULL, config, NULL, filename, filenames); // File of interest
 
     if (success) {
@@ -685,6 +742,6 @@
 }
 
-pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config,
-                                 const char *filename, const char *argname)
+// find the file associated with the argname & bind it to the given pmFPAfile for it based on the filerule
+pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname)
 {
     PS_ASSERT_PTR_NON_NULL(input, NULL);
@@ -710,5 +767,5 @@
     }
 
-    pmFPAfile *file = fpaFileDefineFromArray(config, input, filename, filenames); // File of interest
+    pmFPAfile *file = fpaFileDefineFromArray(NULL, config, input, filename, filenames); // File of interest
 
     if (success) {
@@ -719,6 +776,6 @@
 }
 
-pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename,
-                                         const char *argname, int entry)
+// find the specific file associated with the argname & generate a pmFPAfile for it based on the filerule
+pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname, int entry)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -746,5 +803,5 @@
     psArray *single = psArrayAlloc(1);  // Array of single filename of interest
     single->data[0] = psMemIncrRefCounter(filenames->data[entry]);
-    pmFPAfile *file = fpaFileDefineFromArray(config, NULL, filename, single); // File of interest
+    pmFPAfile *file = fpaFileDefineFromArray(NULL, config, NULL, filename, single); // File of interest
     psFree(single);
 
@@ -756,4 +813,5 @@
 }
 
+// find the file in the config list & generate a pmFPAfile for it based on the filerule
 pmFPAfile *pmFPAfileDefineFromRun(bool *success, pmFPAfile *bind, pmConfig *config, const char *filename)
 {
@@ -769,5 +827,5 @@
     }
 
-    pmFPAfile *file = fpaFileDefineFromArray(config, bind, filename, filenames); // File of interest
+    pmFPAfile *file = fpaFileDefineFromArray(NULL, config, bind, filename, filenames); // File of interest
     psFree(filenames);
 
@@ -779,4 +837,5 @@
 }
 
+// find the files in the config list & generate an array of pmFPAfiles for them based on the filerule
 psArray *pmFPAfileDefineMultipleFromRun(bool *success, psArray *bind, pmConfig *config, const char *filename)
 {
@@ -808,5 +867,5 @@
         dummy->data[0] = files->data[i];
         pmFPAfile *bindFile = bind ? bind->data[i] : NULL; // File to which to bind
-        files->data[i] = psMemIncrRefCounter(fpaFileDefineFromArray(config, bindFile, filename, dummy));
+        files->data[i] = psMemIncrRefCounter(fpaFileDefineFromArray(NULL, config, bindFile, filename, dummy));
         if (!files->data[i]) {
             psError(psErrorCodeLast(), false, "Unable to define file %s %d", filename, i);
@@ -823,4 +882,38 @@
 
     return files;
+}
+
+// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
+pmFPAfile *pmFPAfileDefineNewConfig(bool *success, pmConfig **outConfig, pmConfig *sysConfig, const char *filename, const char *argname)
+{
+    PS_ASSERT_PTR_NON_NULL(outConfig, NULL);
+    PS_ASSERT_PTR_NON_NULL(sysConfig, NULL);
+    PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
+    PS_ASSERT_STRING_NON_EMPTY(argname, NULL);
+
+    // Search the argument data for the named fileset (argname)
+    bool status;                        // Status of MD lookup
+    psArray *filenames = psMetadataLookupPtr(&status, sysConfig->arguments, argname); // Filenames for file
+    if (!status) {
+        if (success) {
+            *success = true;
+        }
+        return NULL;
+    }
+    if (filenames->n == 0) {
+        psError(PM_ERR_CONFIG, true, "No files in array in %s in arguments", argname);
+        if (success) {
+            *success = false;
+        }
+        return NULL;
+    }
+
+    pmFPAfile *file = fpaFileDefineFromArray(outConfig, sysConfig, NULL, filename, filenames); // File of interest
+
+    if (success) {
+        *success = file ? true : false;
+    }
+
+    return file;
 }
 
Index: /trunk/psModules/src/camera/pmFPAfileDefine.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileDefine.h	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAfileDefine.h	(revision 35561)
@@ -81,4 +81,14 @@
     const char *filename                ///< Name of file
     );
+
+// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
+pmFPAfile *pmFPAfileDefineNewConfig(
+    bool *success,                      ///< Found files?
+    pmConfig **outConfig, 		///< output configuration for this file
+    pmConfig *sysConfig, 		///< existing system config info
+    const char *filename, 		///< name of filerule
+    const char *argname			///< argument entry
+    );
+
 
 // look for the given argname on the argument list.  find the give filename from the file rules
Index: /trunk/psModules/src/camera/pmFPAfileIO.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileIO.c	(revision 35560)
+++ /trunk/psModules/src/camera/pmFPAfileIO.c	(revision 35561)
@@ -382,8 +382,8 @@
     // (existing) fpa
     if (file->type == PM_FPA_FILE_CMF) {
-        if (!pmFPAviewCheckDataStatusForSources (view, file)) {
-        psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
-        return true;
-      }
+	if (!pmFPAviewCheckDataStatusForSources (view, file)) {
+	    psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
+	    return true;
+	}
     }
     if (file->type == PM_FPA_FILE_PSF) {
