Index: trunk/pswarp/src/Makefile.am
===================================================================
--- trunk/pswarp/src/Makefile.am	(revision 23629)
+++ trunk/pswarp/src/Makefile.am	(revision 23688)
@@ -24,5 +24,5 @@
 	pswarpMatchRange.c		\
 	pswarpParseCamera.c		\
-	pswarpPixelFraction.c		\
+	pswarpPixelsLit.c		\
 	pswarpSetMaskBits.c		\
 	pswarpSetThreads.c	        \
Index: trunk/pswarp/src/pswarp.h
===================================================================
--- trunk/pswarp/src/pswarp.h	(revision 23629)
+++ trunk/pswarp/src/pswarp.h	(revision 23688)
@@ -102,8 +102,8 @@
                           const char *filename, const char *argname);
 
-/// Check to see if the readout has a minimum fraction of "lit" pixels
-bool pswarpPixelFraction(const pmReadout *readout, ///< Readout to inspect
-                         psMetadata *stats, ///< Statistics to update with the result
-                         const pmConfig *config ///< Configuration
+/// Get the range of lit pixels
+bool pswarpPixelsLit(const pmReadout *readout, ///< Readout to inspect
+                     psMetadata *stats, ///< Statistics to update with the result
+                     const pmConfig *config ///< Configuration
     );
 
Index: trunk/pswarp/src/pswarpArguments.c
===================================================================
--- trunk/pswarp/src/pswarpArguments.c	(revision 23629)
+++ trunk/pswarp/src/pswarpArguments.c	(revision 23688)
@@ -163,10 +163,4 @@
     }
 
-    float acceptFrac = psMetadataLookupF32(&status, recipe, "ACCEPT.FRAC"); ///< Min fraction of good pixels
-    if (!status) {
-        acceptFrac = 0.0;
-        psWarning("ACCEPT.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac);
-    }
-
     // Set recipe values in the recipe (since we've possibly altered some)
     psMetadataAddS32(recipe, PS_LIST_TAIL, "GRID.NX", PS_META_REPLACE,
@@ -180,6 +174,4 @@
     psMetadataAddF32(recipe, PS_LIST_TAIL, "POOR.FRAC", PS_META_REPLACE,
                      "Fraction of bad flux for a pixel to be marked as poor", poorFrac);
-    psMetadataAddF32(recipe, PS_LIST_TAIL, "ACCEPT.FRAC", PS_META_REPLACE,
-                     "Minimum fraction of good pixels for result to be accepted", acceptFrac);
 
     // Set recipe values in the arguments
@@ -194,6 +186,4 @@
     psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0,
                      "Fraction of bad flux for a pixel to be marked as poor", poorFrac);
-    psMetadataAddF32(config->arguments, PS_LIST_TAIL, "ACCEPT.FRAC", 0,
-                     "Minimum fraction of good pixels for result to be accepted", acceptFrac);
 
     psTrace("pswarp", 1, "Done with pswarpArguments...\n");
Index: trunk/pswarp/src/pswarpErrorCodes.dat
===================================================================
--- trunk/pswarp/src/pswarpErrorCodes.dat	(revision 23629)
+++ trunk/pswarp/src/pswarpErrorCodes.dat	(revision 23688)
@@ -9,2 +9,3 @@
 IO			Problem in FITS I/O
 DATA                    Problem in data values
+NO_OVERLAP		No overlap between input and skycell
Index: trunk/pswarp/src/pswarpLoop.c
===================================================================
--- trunk/pswarp/src/pswarpLoop.c	(revision 23629)
+++ trunk/pswarp/src/pswarpLoop.c	(revision 23688)
@@ -142,4 +142,5 @@
         psFree(resolved);
         stats = psMetadataAlloc();
+        psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
     }
 
@@ -273,14 +274,25 @@
     }
 
+    if (!output->data_exists) {
+        psWarning("No overlap between input and skycell.");
+        if (stats) {
+            psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
+                             "No overlap between input and skycell", PSWARP_ERR_NO_OVERLAP);
+        }
+        psphotFilesActivate(config, false);
+        psFree(cells);
+        psFree(view);
+        return true;
+    }
+
     pmCell *outCell = output->parent;   ///< Output cell
     pmChip *outChip = outCell->parent;  ///< Output chip
     pmFPA *outFPA = outChip->parent;    ///< Output FP
 
-    if (!pswarpPixelFraction(output, stats, config)) {
-        // Don't write output images, and don't bother about anything else
-        output->data_exists = outCell->data_exists = outChip->data_exists = false;
+    if (!pswarpPixelsLit(output, stats, config)) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions.");
         psFree(cells);
         psFree(view);
-        goto COMPLETED;
+        return false;
     }
 
@@ -363,6 +375,6 @@
     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 use those to redetermine the PSF model.
+    // 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")) {
@@ -393,6 +405,14 @@
         // 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;
+            // This is likely a data quality issue
+            // XXX Split into multiple cases using error codes?
+            psErrorStackPrint(stderr, "Unable to determine PSF");
+            psWarning("Unable to determine PSF --- suspect bad data quality.");
+            if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
+                psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
+                                 "Unable to determine PSF", psErrorCodeLast());
+            }
+            psErrorClear();
+            psphotFilesActivate(config, false);
         }
 
@@ -447,5 +467,4 @@
     // Now done with the skycell side of things
 
-    COMPLETED:
     // Write out summary statistics
     if (stats) {
Index: trunk/pswarp/src/pswarpPixelFraction.c
===================================================================
--- trunk/pswarp/src/pswarpPixelFraction.c	(revision 23629)
+++ 	(revision )
@@ -1,102 +1,0 @@
-/** @file pswarpPixelFraction.c
- *
- *  @brief
- *
- *  @ingroup pswarp
- *
- *  @author IfA
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-02-05 20:44:04 $
- *  Copyright 2009 Institute for Astronomy, University of Hawaii
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-#include "pswarp.h"
-
-bool pswarpPixelFraction(const pmReadout *readout, psMetadata *stats, const pmConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(readout, false);
-    PS_ASSERT_IMAGE_NON_NULL(readout->image, false);
-    PS_ASSERT_IMAGE_TYPE(readout->image, PS_TYPE_F32, false);
-    if (!readout->mask) {
-        // Can't do anything
-        return true;
-    }
-    PS_ASSERT_IMAGE_NON_NULL(readout->mask, false);
-    PS_ASSERT_IMAGES_SIZE_EQUAL(readout->mask, readout->image, false);
-    PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, false);
-
-    if (stats) {
-        PS_ASSERT_METADATA_NON_NULL(stats, false);
-    }
-    PS_ASSERT_PTR_NON_NULL(config, false);
-    PS_ASSERT_METADATA_NON_NULL(config->arguments, false);
-
-    bool status; 
-
-    float minFrac = psMetadataLookupF32(NULL, config->arguments, "ACCEPT.FRAC"); ///< Minimum fraction
-
-    // load the recipe
-    psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
-    if (!recipe) {
-        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
-        return false;
-    }
-
-    // output mask bits
-    psImageMaskType maskValue = psMetadataLookupImageMask(&status, recipe, "MASK.OUTPUT"); 
-    psAssert (status, "MASK.OUTPUT was not defined");
-
-    psImage *image = readout->image;    ///< Image of interest
-    psImage *mask = readout->mask;      ///< Mask image
-
-    int numCols = image->numCols, numRows = image->numRows; ///< Size of image
-    long numPix = numCols * numRows;
-
-    // Range of valid pixels
-    int xMin = INT_MAX, xMax = -INT_MAX, yMin = INT_MAX, yMax = -INT_MAX;
-
-    long numBad = 0;                     ///< Number of bad pixels
-    for (int y = 0; y < numRows; y++) {
-        for (int x = 0; x < numCols; x++) {
-            if (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValue) {
-                numBad++;
-            } else {
-                if (y > yMax) {
-                    yMax = y;
-                }
-                if (y < yMin) {
-                    yMin = y;
-                }
-                if (x > xMax) {
-                    xMax = x;
-                }
-                if (x < xMin) {
-                    xMin = x;
-                }
-            }
-        }
-    }
-
-    float goodFrac = (numPix - numBad) / (float)numPix; ///< Fraction of good pixels
-    bool accept = (goodFrac >= minFrac ? true : false); ///< Accept this readout?
-
-    if (stats) {
-        psMetadataAddBool(stats, PS_LIST_HEAD, "ACCEPT", 0, "Accept this readout?", accept);
-
-        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin);
-        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax);
-        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", 0, "Minimum valid y value", yMin);
-        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", 0, "Maximum valid y value", yMax);
-    }
-
-    return accept;
-}
-
Index: trunk/pswarp/src/pswarpPixelsLit.c
===================================================================
--- trunk/pswarp/src/pswarpPixelsLit.c	(revision 23688)
+++ trunk/pswarp/src/pswarpPixelsLit.c	(revision 23688)
@@ -0,0 +1,92 @@
+/** @file pswarpPixelFraction.c
+ *
+ *  @brief
+ *
+ *  @ingroup pswarp
+ *
+ *  @author IfA
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-05 20:44:04 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <pslib.h>
+#include <psmodules.h>
+
+#include "pswarp.h"
+
+bool pswarpPixelsLit(const pmReadout *readout, psMetadata *stats, const pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(readout, false);
+    PS_ASSERT_IMAGE_NON_NULL(readout->image, false);
+    PS_ASSERT_IMAGE_TYPE(readout->image, PS_TYPE_F32, false);
+    if (!readout->mask) {
+        // Can't do anything
+        return true;
+    }
+    PS_ASSERT_IMAGE_NON_NULL(readout->mask, false);
+    PS_ASSERT_IMAGES_SIZE_EQUAL(readout->mask, readout->image, false);
+    PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, false);
+
+    if (!stats) {
+        // No point in continuing --- we record results to the statistics
+        return true;
+    }
+    PS_ASSERT_PTR_NON_NULL(config, false);
+    PS_ASSERT_METADATA_NON_NULL(config->arguments, false);
+
+    bool status;
+
+    // load the recipe
+    psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
+    if (!recipe) {
+        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
+        return false;
+    }
+
+    // output mask bits
+    psImageMaskType maskValue = psMetadataLookupImageMask(&status, recipe, "MASK.OUTPUT");
+    psAssert(status, "MASK.OUTPUT was not defined");
+
+    psImage *image = readout->image;    ///< Image of interest
+    psImage *mask = readout->mask;      ///< Mask image
+
+    int numCols = image->numCols, numRows = image->numRows; ///< Size of image
+
+    // Range of valid pixels
+    int xMin = INT_MAX, xMax = -INT_MAX, yMin = INT_MAX, yMax = -INT_MAX;
+
+    for (int y = 0; y < numRows; y++) {
+        for (int x = 0; x < numCols; x++) {
+            if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValue)) {
+                if (y > yMax) {
+                    yMax = y;
+                }
+                if (y < yMin) {
+                    yMin = y;
+                }
+                if (x > xMax) {
+                    xMax = x;
+                }
+                if (x < xMin) {
+                    xMin = x;
+                }
+            }
+        }
+    }
+
+    if (stats) {
+        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin);
+        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax);
+        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", 0, "Minimum valid y value", yMin);
+        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", 0, "Maximum valid y value", yMax);
+    }
+
+    return true;
+}
+
