Index: /branches/pap/pswarp/pswarpPixelsLit.c
===================================================================
--- /branches/pap/pswarp/pswarpPixelsLit.c	(revision 23679)
+++ /branches/pap/pswarp/pswarpPixelsLit.c	(revision 23679)
@@ -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;
+}
+
Index: /branches/pap/pswarp/src/Makefile.am
===================================================================
--- /branches/pap/pswarp/src/Makefile.am	(revision 23678)
+++ /branches/pap/pswarp/src/Makefile.am	(revision 23679)
@@ -24,5 +24,5 @@
 	pswarpMatchRange.c		\
 	pswarpParseCamera.c		\
-	pswarpPixelFraction.c		\
+	pswarpPixelsLit.c		\
 	pswarpSetMaskBits.c		\
 	pswarpSetThreads.c	        \
Index: /branches/pap/pswarp/src/pswarp.h
===================================================================
--- /branches/pap/pswarp/src/pswarp.h	(revision 23678)
+++ /branches/pap/pswarp/src/pswarp.h	(revision 23679)
@@ -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: /branches/pap/pswarp/src/pswarpLoop.c
===================================================================
--- /branches/pap/pswarp/src/pswarpLoop.c	(revision 23678)
+++ /branches/pap/pswarp/src/pswarpLoop.c	(revision 23679)
@@ -290,5 +290,5 @@
     pmFPA *outFPA = outChip->parent;    ///< Output FP
 
-    if (pswarpPixelFraction(output, stats, config)) {
+    if (pswarpPixelsLit(output, stats, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions.");
         psFree(cells);
Index: anches/pap/pswarp/src/pswarpPixelFraction.c
===================================================================
--- /branches/pap/pswarp/src/pswarpPixelFraction.c	(revision 23678)
+++ 	(revision )
@@ -1,93 +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) {
-        // 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;
-
-    long numGood = 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))
-                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;
-}
-
