Index: trunk/psphot/src/psphotMergeSources.c
===================================================================
--- trunk/psphot/src/psphotMergeSources.c	(revision 21176)
+++ trunk/psphot/src/psphotMergeSources.c	(revision 21251)
@@ -56,5 +56,6 @@
 }
 
-pmDetections *psphotLoadPSFSources (pmConfig *config, const pmFPAview *view) {
+// extract the input sources corresponding to this readout
+psArray *psphotLoadPSFSources (pmConfig *config, const pmFPAview *view) {
 
     // find the currently selected readout
@@ -65,11 +66,16 @@
     }
 
-    pmDetections *detections = pmDetectionsAlloc();
-
     psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
     if (!sources) {
         psLogMsg ("psphot", 3, "no psf sources for this readout");
-        return detections;
     }
+
+    return sources;
+}
+
+// generate the detection structure for the supplied array of sources
+pmDetections *psphotDetectionsFromSources (pmConfig *config, psArray *sources) {
+
+    pmDetections *detections = pmDetectionsAlloc();
 
     detections->peaks = psArrayAllocEmpty(100);
