Index: /trunk/ppStack/src/ppStack.h
===================================================================
--- /trunk/ppStack/src/ppStack.h	(revision 14810)
+++ /trunk/ppStack/src/ppStack.h	(revision 14811)
@@ -37,4 +37,5 @@
 bool ppStackMatch(pmReadout *output,    ///< Convolved readout
                   const pmReadout *input, ///< Readout to be convolved
+                  const pmReadout *sourcesRO, ///< Readout with sources
                   const pmConfig *config ///< Configuration
     );
Index: /trunk/ppStack/src/ppStackArguments.c
===================================================================
--- /trunk/ppStack/src/ppStackArguments.c	(revision 14810)
+++ /trunk/ppStack/src/ppStackArguments.c	(revision 14811)
@@ -19,5 +19,5 @@
 {
     fprintf(stderr, "\nPan-STARRS Image combination\n\n");
-    fprintf(stderr, "Usage: %s INPUTS.mdc OUTPUT_ROOT -target FWHM -stamps FILENAME\n"
+    fprintf(stderr, "Usage: %s INPUTS.mdc OUTPUT_ROOT [-target FWHM] [-sources STAMPS.cmf]\n"
             "where INPUTS.mdc contains various METADATAs, each with:\n"
             "\tIMAGE(STR):     Image filename\n"
@@ -101,4 +101,6 @@
     assert(config);
 
+    pmConfigFileSetsMD(config->arguments, &argc, argv, "PPSTACK.SOURCES", "-sources", NULL);
+
     psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-stamps", 0, "Stamps file with x,y,flux per line", NULL);
Index: /trunk/ppStack/src/ppStackCamera.c
===================================================================
--- /trunk/ppStack/src/ppStackCamera.c	(revision 14810)
+++ /trunk/ppStack/src/ppStackCamera.c	(revision 14811)
@@ -214,4 +214,16 @@
     }
 
+    // Sources for use as stamps
+    bool status = false;                // Found the file?
+    pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.SOURCES", "PPSTACK.SOURCES");
+    if (!status) {
+        psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.SOURCES");
+        return false;
+    }
+    if (sources && sources->type != PM_FPA_FILE_CMF) {
+        psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF");
+        return false;
+    }
+
     // For photometry, we operate on the chip-mosaicked image
     // we create a copy of the mosaicked image for psphot so we can write out a clean image
Index: /trunk/ppStack/src/ppStackMatch.c
===================================================================
--- /trunk/ppStack/src/ppStackMatch.c	(revision 14810)
+++ /trunk/ppStack/src/ppStackMatch.c	(revision 14811)
@@ -11,5 +11,6 @@
 //#define TESTING
 
-bool ppStackMatch(pmReadout *output, const pmReadout *input, const pmConfig *config)
+bool ppStackMatch(pmReadout *output, const pmReadout *input, const pmReadout *sourcesRO,
+                  const pmConfig *config)
 {
     // Look up appropriate values from the ppSub recipe
@@ -51,8 +52,11 @@
     }
 
+    psArray *sources = psMetadataLookupPtr(&mdok, sourcesRO->analysis, "PSPHOT.SOURCES"); // Sources in image
+
     // Do the image matching
-    if (!pmSubtractionMatch(output, input, NULL, footprint, regionSize, spacing, threshold, stampsName,
-                            target, type, size, order, widths, orders, inner, ringsOrder, binning, optimum,
-                            optWidths, optOrder, optThresh, iter, rej, maskBad, maskBlank)) {
+    if (!pmSubtractionMatch(output, input, NULL, footprint, regionSize, spacing, threshold, sources,
+                            stampsName, target, type, size, order, widths, orders, inner, ringsOrder,
+                            binning, optimum, optWidths, optOrder, optThresh, iter, rej, maskBad,
+                            maskBlank)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to match images.");
         return false;
Index: /trunk/ppStack/src/ppStackReadout.c
===================================================================
--- /trunk/ppStack/src/ppStackReadout.c	(revision 14810)
+++ /trunk/ppStack/src/ppStackReadout.c	(revision 14811)
@@ -34,4 +34,5 @@
     // Get the input sources
     psArray *stack = psArrayAllocEmpty(ARRAY_BUFFER); // The stack of inputs
+    pmReadout *sources = pmFPAfileThisReadout(config->files, view, "PPSTACK.SOURCES"); // Sources for stamps
     psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD,
                                                            "^PPSTACK.INPUT$"); // Iterator over input files
@@ -82,5 +83,5 @@
         // Generate convolved version of input
         pmReadout *convolved = pmReadoutAlloc(NULL); // Convolved version of input readout
-        if (!ppStackMatch(convolved, ro, config)) {
+        if (!ppStackMatch(convolved, ro, sources, config)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to match image %d.", fileNum);
             psFree(stats);
