Index: trunk/ppImage/src/ppFocus.c
===================================================================
--- trunk/ppImage/src/ppFocus.c	(revision 7706)
+++ trunk/ppImage/src/ppFocus.c	(revision 7738)
@@ -25,14 +25,34 @@
     }
     
-    
-    
-
-    // Image Arithmetic Loop
-    if (!ppImageLoop(config, options)) {
-        psErrorStackPrint(stderr, "");
+    // we search the argument data for the named fileset (argname)
+    psArray *infiles = psMetadataLookupPtr(NULL, config->arguments, "INPUT");
+    if (!infiles) {
+        psTrace("pmFPAfile", 5, "Failed to find INPUT in argument list");
         exit(1);
     }
 
-    psLogMsg ("ppImage", 3, "complete ppImage run: %f sec\n", psTimerMark (TIMERNAME));
+    // allocate vectors for analysis
+    psVector *focus = psVectorAlloc (infiles->n, PS_TYPE_F32);
+    psVector *fwhm = psVectorAlloc (infiles->n, PS_TYPE_F32);
+
+    for (int i = 0; i < infiles->n; i++) {
+
+	// Image Arithmetic Loop
+	if (!ppImageLoop(config, options)) {
+	    psErrorStackPrint(stderr, "");
+	    exit(1);
+	}
+	
+	// determine FWHM at reference location in image
+	// (also removes PPIMAGE.INPUT from config->files)
+	ppFocusGetFWHM (config, focus, fwhm);
+
+	// silently ignore failure for (i == infiles->n)
+	pmFPAfileDefineSingleFromArgs (NULL, config, "PPIMAGE.INPUT", "INPUT", i+1);
+    }
+
+    ppFocusFitFWHM (config, focus, fwhm);
+
+    psLogMsg ("ppFocus", 3, "complete ppFocus run: %f sec\n", psTimerMark (TIMERNAME));
 
     // Cleaning up
@@ -44,3 +64,3 @@
 // - the input list is a set of independent images (not multiple files for a single image)
 // - each pass to ppImageLoop performs the analysis on a different pmFPAfile
-// - 
+// - after each ppImageLoop, grap the input pmFPAfile and extract the FWHM stats
