Index: /branches/eam_branches/ipp-20110710/psphot/src/psphotExtendedSourceAnalysis.c
===================================================================
--- /branches/eam_branches/ipp-20110710/psphot/src/psphotExtendedSourceAnalysis.c	(revision 32309)
+++ /branches/eam_branches/ipp-20110710/psphot/src/psphotExtendedSourceAnalysis.c	(revision 32310)
@@ -7,4 +7,7 @@
 {
     bool status = true;
+
+    fprintf (stdout, "\n");
+    psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Extended Source Analysis (Petrosians) ---");
 
     // select the appropriate recipe information
@@ -204,4 +207,9 @@
 	pmSource *source = sources->data[i];
 
+	// if we have checked the source validity on the basis of the object set, then 
+	// we either skip these tests below or we skip the source completely
+	if (source->tmpFlags & PM_SOURCE_TMPF_STACK_SKIP) continue;
+	if (source->tmpFlags & PM_SOURCE_TMPF_STACK_KEEP) goto keepSource;
+
 	// skip PSF-like and non-astronomical objects
 	if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
@@ -217,12 +225,21 @@
 
 	// limit selection to some SN limit
-	assert (source->peak); // how can a source not have a peak?
-	if (sqrt(source->peak->detValue) < SN_LIM) continue;
-
-	// limit selection by analysis region
+	// assert (source->peak); // how can a source not have a peak?
+	// limit selection to some SN limit
+	bool skipSource = false;
+	if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) {
+	    skipSource = (source->moments->KronFlux < SN_LIM * source->moments->KronFluxErr);
+	} else {
+	    skipSource = (sqrt(source->peak->detValue) < SN_LIM);
+	}
+	if (skipSource) continue;
+
+	// limit selection by analysis region (this automatically apply
 	if (source->peak->x < region->x0) continue;
 	if (source->peak->y < region->y0) continue;
 	if (source->peak->x > region->x1) continue;
 	if (source->peak->y > region->y1) continue;
+
+    keepSource:
 
 	// replace object in image
