Index: trunk/ppStack/src/ppStackCamera.c
===================================================================
--- trunk/ppStack/src/ppStackCamera.c	(revision 17916)
+++ trunk/ppStack/src/ppStackCamera.c	(revision 18346)
@@ -72,5 +72,6 @@
 {
     bool haveWeights = false;           // Do we have weight maps?
-    bool havePSFs = false;               // Do we have PSFs?
+    bool havePSFs = false;              // Do we have PSFs?
+    bool haveSources = (bool)psMetadataLookup(config->arguments, "PPSTACK.SOURCES"); // Have global sources?
 
     psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
@@ -99,4 +100,5 @@
         psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
         psString psf = psMetadataLookupStr(&mdok, input, "PSF"); // Name of PSF
+        psString sources = psMetadataLookupStr(&mdok, input, "SOURCES"); // Name of sources
 
         float weighting = psMetadataLookupF32(&mdok, input, "WEIGHTING"); // Relative weighting
@@ -198,4 +200,38 @@
         }
 
+        // Add the sources file
+        if (!haveSources) {
+            if (!sources || strlen(sources) == 0) {
+                if (havePSFs) {
+                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SOURCES %d", i);
+                    return false;
+                }
+            } else {
+                if (!havePSFs) {
+                    psWarning("SOURCES provided without PSF --- ignoring.");
+                } else {
+                    psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA
+                    sourcesFiles->data[0] = psMemIncrRefCounter(sources);
+                    psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE,
+                                       "Filenames of SOURCES files", sourcesFiles);
+                    psFree(sourcesFiles);
+
+                    bool status;
+                    pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config,
+                                                                   "PPSTACK.INPUT.SOURCES",
+                                                                   "SOURCES.FILENAMES");
+                    if (!status) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)",
+                                i, sources);
+                        return false;
+                    }
+                    if (sourcesFile->type != PM_FPA_FILE_CMF) {
+                        psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF");
+                        return false;
+                    }
+                }
+            }
+        }
+
 #if 0
         // Output convolved files
@@ -238,7 +274,29 @@
         psMetadataRemoveKey(config->arguments, "PSF.FILENAMES");
     }
+    if (psMetadataLookup(config->arguments, "SOURCES.FILENAMES")) {
+        psMetadataRemoveKey(config->arguments, "SOURCES.FILENAMES");
+    }
+
+    if (haveSources) {
+        // Global list of sources for use as stamps
+        bool status = false;            // Found the file?
+        if (havePSFs) {
+            pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.INPUT.SOURCES",
+                                                         "PPSTACK.SOURCES");
+            if (!status) {
+                psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.INPUT.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;
+            }
+        }
+    }
 
     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", i);
     psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.PSF", 0, "Have PSFs available?", havePSFs);
+    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.SOURCES", 0, "Have global sources?",
+                      haveSources);
 
     // Output image
@@ -326,18 +384,4 @@
     }
 
-    // Sources for use as stamps
-    bool status = false;                // Found the file?
-    if (havePSFs) {
-        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;
-        }
-    }
-
     return true;
 }
