Index: trunk/psastro/src/psastroConvert.c
===================================================================
--- trunk/psastro/src/psastroConvert.c	(revision 41895)
+++ trunk/psastro/src/psastroConvert.c	(revision 42293)
@@ -18,5 +18,5 @@
 # define PHOT_SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_BLEND | PM_SOURCE_MODE_BADPSF | \
                            PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT | \
-                           PM_SOURCE_MODE_POOR) // Mask to apply to sources for rejection
+                           PM_SOURCE_MODE_POOR ) // Mask to apply to sources for rejection
 
 static psArray *chooseStars(psArray *inStars, char *listName, psArray *sources, psVector *index, int nMax, float iMagMin, float iMagMax, pmSourceMode skip);
@@ -193,4 +193,5 @@
     int nBrightSkip = 0;
     int nInfSkip = 0;
+    int nCTESkip = 0;
 
     for (int i = 0; (i < inStars->n) && (j < rawStars->n); i++) {
@@ -217,4 +218,10 @@
           continue;
         }
+	//Also kick out stars that touch the CTE region
+        if (source->mode2 & PM_SOURCE_MODE2_ON_CTE) {
+            nCTESkip ++;
+            continue;
+        }
+	
         mMin = PS_MIN (mMin, source->psfMag);
         mMax = PS_MAX (mMax, source->psfMag);
@@ -225,5 +232,5 @@
 
     psLogMsg ("psastro", 4, "loaded %ld %ssources, using %ld of %ld good sources (inst mag: %f to %f)\n", sources->n, listName, rawStars->n, inStars->n, mMin, mMax);
-    psLogMsg ("psastro", 4, "skip reasons: mode: %d, faint: %d, bright: %d, inf: %d\n", nModeSkip, nFaintSkip, nBrightSkip, nInfSkip);
+    psLogMsg ("psastro", 4, "skip reasons: mode: %d, faint: %d, bright: %d, inf: %d, CTE: %d\n", nModeSkip, nFaintSkip, nBrightSkip, nInfSkip,nCTESkip);
 
     return rawStars;
@@ -509,4 +516,6 @@
   float myPltScale = fabs(pltScale[chipID]);
 
+  psLogMsg ("psastro.correctKH", PS_LOG_INFO, "applying KH correction to %s (%d)\n", chipName, chipID);
+
   // apply the correction to the detections
   for (int i = 0; i < inStars->n; i++) {
