Index: /trunk/psphot/src/psphot.h
===================================================================
--- /trunk/psphot/src/psphot.h	(revision 11229)
+++ /trunk/psphot/src/psphot.h	(revision 11230)
@@ -98,5 +98,3 @@
 bool psphotFitSummary ();
 bool psphotMergeSources (psArray *oldSources, psArray *newSources);
-
-bool psphotSaveExtSources (pmReadout *readout);
-bool psphotLoadExtSources (pmReadout *readout, psArray *sources);
+bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources);
Index: /trunk/psphot/src/psphotMergeSources.c
===================================================================
--- /trunk/psphot/src/psphotMergeSources.c	(revision 11229)
+++ /trunk/psphot/src/psphotMergeSources.c	(revision 11230)
@@ -11,28 +11,20 @@
 }
 
-// XXX this is something of a hack: external sources are loaded with the same functions used to
-// read and write the sources.  These use the readout->analysis entry PSPHOT.SOURCES.  at the
-// beginning of psphotReadout, we need to rename any such entry for later use by
-// psphotLoadExtSources below
-
-bool psphotSaveExtSources (pmReadout *readout) {
-
-    psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
-    if (!sources) return true;
-
-    psLogMsg ("psphot", 3, "%ld external sources loaded, saved for later use", sources->n);
-    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.EXTSRC", PS_DATA_ARRAY, "external sources", sources);
-
-    psMetadataRemoveKey (readout->analysis, "PSPHOT.SOURCES");
-
-    return true;
-}
-
 // merge the externally supplied sources with the existing sources.  mark them as having 
 // mode PM_SOURCE_MODE_EXTERNAL
-bool psphotLoadExtSources (pmReadout *readout, psArray *sources) {
+bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources) {
 
-    psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.EXTSRC");
-    if (!extSources) return true;
+    // find the currently selected readout
+    pmReadout  *readout = pmFPAfileThisReadout (config->files, view, "INPUT.SRC");
+    if (!readout) {
+	psLogMsg ("psphot", 3, "no external sources supplied");
+	return true;
+    }
+
+    psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
+    if (!extSources) {
+	psLogMsg ("psphot", 3, "no external sources for this readout");
+	return true;
+    }
 
     for (int i = 0; i < extSources->n; i++) {
Index: /trunk/psphot/src/psphotParseCamera.c
===================================================================
--- /trunk/psphot/src/psphotParseCamera.c	(revision 11229)
+++ /trunk/psphot/src/psphotParseCamera.c	(revision 11230)
@@ -23,5 +23,5 @@
     // optionally load the PSF Model and/or fixed stars
     pmFPAfileBindFromArgs (NULL, input, config, "INPUT.PSF", "PSF");
-    pmFPAfile *srcInput = pmFPAfileBindFromArgs (NULL, input, config, "INPUT.SRC", "SRC");
+    pmFPAfile *srcInput = pmFPAfileDefineFromArgs (NULL, config, "INPUT.SRC", "SRC");
     if (!srcInput) {
 	fprintf (stderr, "!");
Index: /trunk/psphot/src/psphotReadout.c
===================================================================
--- /trunk/psphot/src/psphotReadout.c	(revision 11229)
+++ /trunk/psphot/src/psphotReadout.c	(revision 11230)
@@ -8,5 +8,4 @@
     // find the currently selected readout
     pmReadout  *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT");
-    psphotSaveExtSources (readout);
 
     // optional break-point for processing
@@ -81,5 +80,5 @@
 
     // include externally-supplied sources
-    psphotLoadExtSources (readout, sources);
+    psphotLoadExtSources (config, view, sources);
 
     // construct an initial model for each object 
