Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotSourceMatch.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotSourceMatch.c	(revision 30095)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotSourceMatch.c	(revision 30096)
@@ -187,4 +187,8 @@
         pmPhotObj *obj = objects->data[i]; 
 
+	// we will find the input source with the max number of spans and reproduce that footprint
+	int nSpansMax = 0;
+	int iSpansMax = -1;
+
 	// mark the images for which sources have been found
 	psVectorInit (found, 0);
@@ -196,5 +200,22 @@
 	    psAssert (index < found->n, "invalid index");
 
+	    if (src->peak && src->peak->footprint && src->peak->footprint->nspans > nSpansMax) {
+		nSpansMax = src->peak->footprint->nspans;
+		iSpansMax = j;
+	    }
+
 	    found->data.U8[index] = 1;
+	}
+
+	// we make a copy of the largest footprint; this will be used for all new sources associated with this object
+	pmFootprint *footprint = NULL;
+	if (iSpansMax != -1) { // copy the footprint info
+	    pmSource *src = obj->sources->data[iSpansMax]; 
+	    psAssert(src->peak, "source does not exist?");
+	    psAssert(src->peak->footprint, "footprint does not exist");
+	    psAssert(src->peak->footprint->nspans == nSpansMax, "wrong footprint?");
+	    
+	    // we only care about the spans, do not worry about the image of this footprint
+	    footprint = pmFootprintCopyData(src->peak->footprint, NULL);
 	}
 
@@ -219,5 +240,6 @@
 	    peak->dy = NAN;
 	    
-	    // XXX assign to a footprint?
+	    // assign to a footprint on this readout->image
+	    peak->footprint = pmFootprintCopyData(footprint, readout->image);
 
 	    // create a new source
@@ -241,4 +263,5 @@
 	    psFree (peak);
 	}
+	psFree (footprint);
     }
 
