Index: trunk/psphot/src/psphotExtendedSources.c
===================================================================
--- trunk/psphot/src/psphotExtendedSources.c	(revision 15562)
+++ trunk/psphot/src/psphotExtendedSources.c	(revision 16820)
@@ -1,9 +1,13 @@
 # include "psphot.h"
 
-bool psphotExtendedSources (pmReadout *readout, psArray *sources, psMetadata *recipe, psMaskType maskVal) {
+bool psphotExtendedSources (pmReadout *readout, psArray *sources, psMetadata *recipe) {
 
     bool status;
     int Next = 0;
     int Npsf = 0;
+
+    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
+    psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels
+    assert (maskVal);
 
     // S/N limit to perform full non-linear fits
@@ -117,5 +121,4 @@
         pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
         source->mode |= PM_SOURCE_MODE_SUBTRACTED;
-        source->mode |= PM_SOURCE_MODE_TEMPSUB;
     }
 
