Index: trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c
===================================================================
--- trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c	(revision 27666)
+++ trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c	(revision 27667)
@@ -75,5 +75,5 @@
                 psVector *xOffset = NULL, *yOffset = NULL; // Offset from source to true position
 
-                if (sources || (data->fakeNum > 0 && isfinite(data->fakeMag))) {
+                if (sources || data->input || (data->fakeNum > 0 && isfinite(data->fakeMag))) {
                     numCols = psf->fieldNx;
                     numRows = psf->fieldNy;
@@ -82,6 +82,10 @@
                 if (sources) {
                     psMemIncrRefCounter(sources);
-                    psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources", sources->n);
-                }
+                    psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from CMF file", sources->n);
+                } else if (data->input) {
+                    psVector *x = data->input->data[0]; // x coordinates
+                    psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from text file", x->n);
+                }
+
                 if (data->fakeNum > 0 && isfinite(data->fakeMag)) {
                     long numOld = 0; // Old number of sources
@@ -113,5 +117,5 @@
                     }
                 }
-                if (!sources) {
+                if (!sources && !data->input) {
                     // Generate fake image with only a single realisation of the PSF
                     sources = psArrayAlloc(1);
@@ -137,8 +141,4 @@
                     psRegion *trimsec = psMetadataLookupPtr(NULL, cell->concepts, "CELL.TRIMSEC");
                     *trimsec = psRegionSet(0, numCols, 0, numRows);
-
-                    // We have trouble with PSF residuals in this case, so don't use them
-                    psFree(psf->residuals);
-                    psf->residuals = NULL;
                 }
 
@@ -148,8 +148,23 @@
                 }
 
-                if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset, psf,
-                                              data->minFlux, 0, false, true)) {
-                    psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout.");
-                    return false;
+                // We have trouble with PSF residuals, so don't use them
+                psFree(psf->residuals);
+                psf->residuals = NULL;
+
+                if (sources) {
+                    if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset,
+                                                  psf, data->minFlux, 0, false, true)) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout.");
+                        return false;
+                    }
+                } else if (data->input) {
+                    psVector *x = data->input->data[0]; // x coordinates
+                    psVector *y = data->input->data[1]; // y coordinates
+                    psVector *mag = data->input->data[2]; // Magnitudes
+                    if (!pmReadoutFakeFromVectors(readout, numCols, numRows, x, y, mag, xOffset, yOffset,
+                                                  psf, data->minFlux, 0, false, true)) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout.");
+                        return false;
+                    }
                 }
 
