Index: trunk/psphot/src/psphotMaskReadout.c
===================================================================
--- trunk/psphot/src/psphotMaskReadout.c	(revision 23289)
+++ trunk/psphot/src/psphotMaskReadout.c	(revision 23306)
@@ -29,4 +29,17 @@
     }
 
+    // make this an option via the recipe
+    if (0) {
+      psImage *im = readout->image;
+      psImage *wt = readout->variance;
+      psImage *mk = readout->mask;
+      for (int j = 0; j < im->numRows; j++) {
+	for (int i = 0; i < im->numCols; i++) {
+	  if (isfinite(im->data.F32[j][i]) && isfinite(wt->data.F32[j][i])) continue;
+	  mk->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskBad;
+	}
+      }
+    }
+
     // mask the excluded outer pixels
     // these coordinates refer to the parent image
