Index: branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceIO.c
===================================================================
--- branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceIO.c	(revision 35381)
+++ branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceIO.c	(revision 35413)
@@ -980,4 +980,5 @@
 	    return false;
         }
+
         // if this is not TRUE, the output files only contain the psf measurements.
         bool XSRC_OUTPUT = psMetadataLookupBool(&status, recipe, "EXTENDED_SOURCE_ANALYSIS");
@@ -1005,4 +1006,15 @@
             hdu->header = psFitsReadHeader (NULL, file->fits);
         }
+
+	// "WCS" is CMF without detected objects
+	if (file->type == PM_FPA_FILE_WCS) {
+	  psTrace("psModules.objects", 6, "read CMF table from %s : %s : %s", file->filename, headname, dataname);
+	  psFree (headname);
+	  psFree (dataname);
+	  psFree (deteffname);
+	  break;
+	}
+
+	// EXTDATA is the PSF data associated with this image header
 
         // we need to find the corresponding table EXTNAME.
Index: branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.c
===================================================================
--- branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.c	(revision 35381)
+++ branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.c	(revision 35413)
@@ -630,4 +630,5 @@
 
 psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches
+			       psArray *matchedSources, // Array of averaged sources
                                const psVector *zp, // Zero points for each image (including airmass term)
                                float tol, // Relative tolerance for convergence
@@ -648,5 +649,6 @@
     PS_ASSERT_VECTOR_TYPE(zp, PS_TYPE_F32, NULL);
     PS_ASSERT_FLOAT_LARGER_THAN(transClip, 0.0, NULL);
-
+    PS_ASSERT_ARRAY_NON_NULL(matchedSources, NULL);
+    
     sys1 *= sys1;
     sys2 *= sys2;
@@ -742,4 +744,10 @@
     }
 
+    for (int i = 0; i < matches->n; i++) {
+      pmSource *source = pmSourceAlloc();
+      source->psfMag = stars->data.F32[i];
+      psArrayAdd(matchedSources,matchedSources->n,source);
+    }
+    
     psFree(photo);
     psFree(badImage);
Index: branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.h
===================================================================
--- branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.h	(revision 35381)
+++ branches/eam_branches/ipp-20130307/psModules/src/objects/pmSourceMatch.h	(revision 35413)
@@ -74,4 +74,5 @@
 /// Perform relative photometry to calibrate images
 psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches
+			       psArray *matchedSources, // Array of average sources
                                const psVector *zp, // Zero points for each image (including airmass term)
                                float tol, // Relative tolerance for convergence
