Index: trunk/pswarp/src/pswarpLoop.c
===================================================================
--- trunk/pswarp/src/pswarpLoop.c	(revision 21183)
+++ trunk/pswarp/src/pswarpLoop.c	(revision 21256)
@@ -322,31 +322,12 @@
     fileActivation(config, independentFiles, false);
 
-    // We need a new PSF model for the warped frame
-    // It would be good to generate this analytically, but that's going to be tricky.
-    // We have a list of sources, so we could use those to redetermine the PSF model.
-    // Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from
-    // scratch.
+    // We need a new PSF model for the warped frame.  It would be good to generate this analytically, but that's going to be tricky.
+    // We have a list of sources, so we use those to redetermine the PSF model.
+
     if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) {
         fileActivation(config, photFiles, true);
         ioChecksBefore(config);
 
-        // Tweak recipe
-        psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes,
-                                                       PSPHOT_RECIPE); // Recipe for psphot
-        if (!psphotRecipe) {
-            psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE);
-            return false;
-        }
-
-        psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE,
-                         "Break point for psphot operations", "PSFMODEL");
-        psMetadataAddBool(psphotRecipe, PS_LIST_TAIL, PSPHOT_RECIPE_PSF_FAKE_ALLOW, PS_META_REPLACE,
-                          "Don't allow psphot to fit a fake PSF!", false);
-
-#if !PSPHOT_FIND_PSF
-        // Get rid of the transformed sources so that we can measure the PSF
-        psMetadataRemoveKey(output->analysis, "PSPHOT.SOURCES");
-#endif
-
+	// supply the readout and fpa of interest to psphot
         pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
         pmFPACopy(photFile->fpa, outFPA);
@@ -355,5 +336,4 @@
         view->chip = view->cell = view->readout = 0;
 
-#if PSPHOT_FIND_PSF
         // Need to adjust the weight --- the main operation in psphotReadoutFindPSF is not determining the
         // signficance of sources, but looking at the significance of individual pixels.
@@ -363,15 +343,18 @@
         psBinaryOp(photRO->weight, photRO->weight, "*", psScalarAlloc(vf, PS_TYPE_F32));
 
-        if (!psphotReadoutFindPSF(config, view)) {
+	// grab the sources of interest from the storage location (pmFPAfile PSPHOT.INPUT.CMF)
+	psArray *sources = psphotLoadPSFSources (config, view);
+	if (!sources) {
+            psError(PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF");
+            return false;
+        }
+
+	// measure the PSF using these sources
+        if (!psphotReadoutFindPSF(config, view, sources)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
             return false;
         }
-#else
-        if (!psphotReadout(config, view)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
-            return false;
-        }
-#endif
-
+
+// XXX EAM : put this in a visualization function
 #if (TESTING)
         {
