Index: trunk/ppStack/src/ppStackPrepare.c
===================================================================
--- trunk/ppStack/src/ppStackPrepare.c	(revision 23341)
+++ trunk/ppStack/src/ppStackPrepare.c	(revision 23573)
@@ -127,22 +127,22 @@
     psVectorInit(options->inputMask, 0);
 
-    if (psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) {
-        pmFPAfileActivate(config->files, false, NULL);
-        ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
-        pmFPAview *view = ppStackFilesIterateDown(config);
-        if (!view) {
-            return false;
-        }
-
-        // Generate list of PSFs
-        psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD,
-                                                               "^PPSTACK.INPUT$"); // Iterator
-        psMetadataItem *fileItem; // Item from iteration
-        psArray *psfs = psArrayAlloc(num); // PSFs for PSF envelope
-        int numCols = 0, numRows = 0;   // Size of image
-        int index = 0;                  // Index for file
-        while ((fileItem = psMetadataGetAndIncrement(fileIter))) {
-            assert(fileItem->type == PS_DATA_UNKNOWN);
-            pmFPAfile *inputFile = fileItem->data.V; // An input file
+    pmFPAfileActivate(config->files, false, NULL);
+    ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
+    pmFPAview *view = ppStackFilesIterateDown(config);
+    if (!view) {
+        return false;
+    }
+
+    psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, "^PPSTACK.INPUT$");
+    psMetadataItem *fileItem; // Item from iteration
+    psArray *psfs = psArrayAlloc(num); // PSFs for PSF envelope
+    int numCols = 0, numRows = 0;   // Size of image
+    int index = 0;                  // Index for file
+    while ((fileItem = psMetadataGetAndIncrement(fileIter))) {
+        assert(fileItem->type == PS_DATA_UNKNOWN);
+        pmFPAfile *inputFile = fileItem->data.V; // An input file
+
+        // Get list of PSFs, to determine target PSF
+        if (options->convolve) {
             pmChip *chip = pmFPAviewThisChip(view, inputFile->fpa); // The chip: holds the PSF
             pmPSF *psf = psMetadataLookupPtr(NULL, chip->analysis, "PSPHOT.PSF"); // PSF
@@ -173,57 +173,51 @@
                 numRows = naxis2;
             }
-
-            pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
-            psArray *sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
-            if (!sources) {
-                psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
-                return NULL;
-            }
-            options->sourceLists->data[index] = psMemIncrRefCounter(sources);
-
-            // Re-do photometry if we don't trust the source lists
-            if (psMetadataLookupBool(NULL, recipe, "PHOT")) {
-                psTrace("ppStack", 2, "Photometering input %d of %d....\n", index, num);
-                pmFPAfileActivate(config->files, false, NULL);
-                ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index);
-                pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File
-                pmFPAview *photView = ppStackFilesIterateDown(config);
-                if (!photView) {
-                    psFree(view);
-                    return false;
-                }
-
-                pmReadout *ro = pmFPAviewThisReadout(view, file->fpa); // Readout of interest
-
-                if (!ppStackInputPhotometer(ro, sources, config)) {
-                    psError(PS_ERR_UNKNOWN, false, "Unable to do photometry on input sources");
-                    psFree(view);
-                    psFree(photView);
-                    return false;
-                }
-
+        }
+
+
+        pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
+        psArray *sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
+        if (!sources) {
+            psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
+            return NULL;
+        }
+        options->sourceLists->data[index] = psMemIncrRefCounter(sources);
+
+        // Re-do photometry if we don't trust the source lists
+        if (psMetadataLookupBool(NULL, recipe, "PHOT")) {
+            psTrace("ppStack", 2, "Photometering input %d of %d....\n", index, num);
+            pmFPAfileActivate(config->files, false, NULL);
+            ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index);
+            pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File
+            pmFPAview *photView = ppStackFilesIterateDown(config);
+            if (!photView) {
+                psFree(view);
+                return false;
+            }
+
+            pmReadout *ro = pmFPAviewThisReadout(view, file->fpa); // Readout of interest
+
+            if (!ppStackInputPhotometer(ro, sources, config)) {
+                psError(PS_ERR_UNKNOWN, false, "Unable to do photometry on input sources");
+                psFree(view);
                 psFree(photView);
-                if (!ppStackFilesIterateUp(config)) {
-                    psFree(view);
-                    return false;
-                }
-                pmFPAfileActivate(config->files, false, NULL);
-                ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
-            }
-
-            index++;
-        }
-        psFree(fileIter);
-
-        // Zero point calibration
-        options->sumExposure = ppStackSourcesTransparency(options->sourceLists, options->inputMask,
-                                                          view, config);
-        if (!isfinite(options->sumExposure) || options->sumExposure <= 0) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to calculate transparency differences");
-            psFree(view);
-            return false;
-        }
-
-        // Generate target PSF
+                return false;
+            }
+
+            psFree(photView);
+            if (!ppStackFilesIterateUp(config)) {
+                psFree(view);
+                return false;
+            }
+            pmFPAfileActivate(config->files, false, NULL);
+            ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
+        }
+
+        index++;
+    }
+    psFree(fileIter);
+
+    // Generate target PSF
+    if (options->convolve) {
         options->psf = ppStackPSF(config, numCols, numRows, psfs, options->inputMask);
         psFree(psfs);
@@ -240,10 +234,16 @@
                          "Target PSF", options->psf);
         outChip->data_exists = true;
-
+    }
+
+    // Zero point calibration
+    if (!ppStackSourcesTransparency(options, view, config)) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to calculate transparency differences");
         psFree(view);
-
-        if (!ppStackFilesIterateUp(config)) {
-            return false;
-        }
+        return false;
+    }
+    psFree(view);
+
+    if (!ppStackFilesIterateUp(config)) {
+        return false;
     }
 
