Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h	(revision 30865)
@@ -84,5 +84,6 @@
 				 const float nsigma_delta, // how many sigma above local background a peak needs to be to survive
 				 const float fPadding, // fractional padding added to stdev since bright peaks have unreasonably high significance
-				 const float min_threshold // minimum permitted coll height
+				 const float min_threshold, // minimum permitted coll height
+				 const float max_threshold // maximum permitted coll height
     );
 
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c	(revision 30865)
@@ -38,5 +38,6 @@
                                  const float nsigma_delta, // how many sigma above local background a peak needs to be to survive
                                  const float fPadding, // fractional padding added to stdev since bright peaks have unreasonably high significance
-                                 const float min_threshold) { // minimum permitted coll height
+                                 const float min_threshold, // minimum permitted coll height
+                                 const float max_threshold) { // maximum permitted coll height
     assert (img != NULL); assert (img->type.type == PS_TYPE_F32);
     assert (weight != NULL); assert (weight->type.type == PS_TYPE_F32);
@@ -119,4 +120,7 @@
 	    threshold = min_threshold;
 	}
+	if (threshold > max_threshold) {
+	    threshold = max_threshold;
+	}
 
 	// init peakFootprint here?
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmMoments.h
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmMoments.h	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmMoments.h	(revision 30865)
@@ -51,10 +51,12 @@
     int nPixels;  ///< Number of pixels used.
 
-    float KronFlux;    ///< Kron flux (flux in 2.5*Mrf)
+    float KronCore;    ///< flux in r < 1.0*Mrf
+    float KronCoreErr;    ///< error on flux in r < 1.0*Mrf
+
+    float KronFlux;    ///< Kron flux (flux in r < 2.5*Mrf)
     float KronFluxErr; ///< Kron flux error
 
-    float KronFinner;    ///< Kron flux (flux in 2.5*Mrf)
-    float KronFouter;    ///< Kron flux (flux in 2.5*Mrf)
-
+    float KronFinner;    ///< Kron flux (flux in 1.0*Mrf < r < 2.5*Mrf)
+    float KronFouter;    ///< Kron flux (flux in 2.5*Mrf < r < 4.0*Mrf)
 }
 pmMoments;
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.h
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.h	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.h	(revision 30865)
@@ -35,4 +35,5 @@
     PM_PEAK_EDGE,                       ///< Peak on edge.
     PM_PEAK_FLAT,                       ///< Peak has equal-value neighbors.
+    PM_PEAK_SUSPECT_SATURATION,         ///< Peak is probably saturated
     PM_PEAK_UNDEF                       ///< Undefined.
 } pmPeakType;
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c	(revision 30865)
@@ -637,4 +637,22 @@
 	    // XXX eliminate the classification?
             if ((source->moments->SN > 10) && (sigX < 0.05 || sigY < 0.05)) {
+                source->type = PM_SOURCE_TYPE_DEFECT;
+                source->mode |= PM_SOURCE_MODE_DEFECT;
+                Ncr ++;
+                continue;
+            }
+
+	    // check for insignificant sources or excessively low-surface brightness
+	    float coreSN = source->moments->KronCore / source->moments->KronCoreErr;
+	    float coreKR = source->moments->KronCore / source->moments->KronFlux;
+
+	    // XXX these values need to be in the recipe...
+	    if (false && isfinite(coreSN) && (coreSN < 5.0)) {
+                source->type = PM_SOURCE_TYPE_DEFECT;
+                source->mode |= PM_SOURCE_MODE_DEFECT;
+                Ncr ++;
+                continue;
+            }
+	    if (false && isfinite(coreKR) && (coreKR < 0.1)) {
                 source->type = PM_SOURCE_TYPE_DEFECT;
                 source->mode |= PM_SOURCE_MODE_DEFECT;
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c	(revision 30865)
@@ -161,4 +161,6 @@
         psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_INNER",  PS_DATA_F32, "Kron Flux (in 2.5 R1)",                      moments.Kinner);
         psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_OUTER",  PS_DATA_F32, "Kron Flux (in 2.5 R1)",                      moments.Kouter);
+        // psMetadataAdd (row, PS_LIST_TAIL, "KRON_CORE_FLUX",   PS_DATA_F32, "Kron Flux (in 1.0 R1)",                      moments.KronCore);
+        // psMetadataAdd (row, PS_LIST_TAIL, "KRON_CORE_ERROR",  PS_DATA_F32, "Kron Error (in 1.0 R1)",                     moments.KronCoreErr);
         psMetadataAdd (row, PS_LIST_TAIL, "FLAGS",            PS_DATA_U32, "psphot analysis flags",                      source->mode);
         psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2",           PS_DATA_U32, "psphot analysis flags",                      source->mode2);
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceMoments.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceMoments.c	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceMoments.c	(revision 30865)
@@ -82,4 +82,6 @@
     psF32 Sum = 0.0;
     psF32 Var = 0.0;
+    psF32 SumCore = 0.0;
+    psF32 VarCore = 0.0;
     psF32 R2 = PS_SQR(radius);
     psF32 minSN2 = PS_SQR(minSN);
@@ -248,4 +250,7 @@
 
     int nKronPix = 0;
+    int nCorePix = 0;
+    int nInner = 0;
+    int nOuter = 0;
     Sum = Var = 0.0;
     float SumInner = 0.0;
@@ -255,5 +260,5 @@
 
 	psF32 yDiff = row - yCM;
-	if (fabs(yDiff) > radKron) continue;
+	if (fabs(yDiff) > radKouter) continue;
 
 	psF32 *vPix = source->pixels->data.F32[row];
@@ -272,5 +277,5 @@
 
 	    psF32 xDiff = col - xCM;
-	    if (fabs(xDiff) > radKron) continue;
+	    if (fabs(xDiff) > radKouter) continue;
 
 	    // radKron is just a function of (xDiff, yDiff)
@@ -293,16 +298,28 @@
 	    }
 
+	    // use sigma (fixed by psf) not a radKron based value
+	    if (r < sigma) {
+		SumCore += pDiff;
+		VarCore += wDiff;
+		nCorePix ++;
+	    }
+
 	    if ((r > radKinner) && (r < radKron)) {
 		SumInner += pDiff;
+		nInner ++;
 	    }
 	    if ((r > radKron)  && (r < radKouter)) {
 		SumOuter += pDiff;
+		nOuter ++;
 	    }
 	}
     }
-    source->moments->KronFlux = Sum;
-    source->moments->KronFinner = SumInner;
-    source->moments->KronFouter = SumOuter;
-    source->moments->KronFluxErr = sqrt(Var);
+    // *** should I rescale these fluxes by pi R^2 / nNpix?
+    source->moments->KronCore    = SumCore       * M_PI * PS_SQR(sigma) / nCorePix;
+    source->moments->KronCoreErr = sqrt(VarCore) * M_PI * PS_SQR(sigma) / nCorePix;
+    source->moments->KronFlux    = Sum       * M_PI * PS_SQR(radKron) / nKronPix;
+    source->moments->KronFluxErr = sqrt(Var) * M_PI * PS_SQR(radKron) / nKronPix;
+    source->moments->KronFinner = SumInner * M_PI * (PS_SQR(radKron)   - PS_SQR(radKinner)) / nInner;
+    source->moments->KronFouter = SumOuter * M_PI * (PS_SQR(radKouter) -   PS_SQR(radKron)) / nOuter;
 
     psTrace ("psModules.objects", 4, "Mrf: %f  KronFlux: %f  Mxx: %f  Mxy: %f  Myy: %f  Mxxx: %f  Mxxy: %f  Mxyy: %f  Myyy: %f  Mxxxx: %f  Mxxxy: %f  Mxxyy: %f  Mxyyy: %f  Mxyyy: %f\n",
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c	(revision 30865)
@@ -170,4 +170,6 @@
     moments->Kinner = source->moments ? source->moments->KronFinner : NAN;
     moments->Kouter = source->moments ? source->moments->KronFouter : NAN;
+    moments->KronCore    = source->moments ? source->moments->KronCore : NAN;
+    moments->KronCoreErr = source->moments ? source->moments->KronCoreErr : NAN;
 
     return true;
Index: /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h
===================================================================
--- /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h	(revision 30864)
+++ /branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h	(revision 30865)
@@ -50,4 +50,6 @@
     float Kinner;
     float Kouter;
+    float KronCore;
+    float KronCoreErr;
 } pmSourceOutputsMoments;
 
