Index: trunk/psModules/src/objects/pmSourceMatch.c
===================================================================
--- trunk/psModules/src/objects/pmSourceMatch.c	(revision 35240)
+++ trunk/psModules/src/objects/pmSourceMatch.c	(revision 35383)
@@ -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);
