Index: /branches/eam_branches/ipp-20220316/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/relphot/include/relphot.h	(revision 42266)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/relphot/include/relphot.h	(revision 42267)
@@ -470,4 +470,5 @@
 int    PRESERVE_PS1;
 int    REQUIRE_PSFFIT;
+int    USE_APER_FOR_STARGAL;
 int    UPDATE;
 int    SAVE_IMAGE_UPDATES;
Index: /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/args.c	(revision 42266)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/args.c	(revision 42267)
@@ -247,4 +247,9 @@
     REQUIRE_PSFFIT = TRUE;
   }
+  USE_APER_FOR_STARGAL = FALSE;
+  if ((N = get_argument (argc, argv, "-use-aper-for-stargal"))) {
+    remove_argument (N, &argc, argv);
+    USE_APER_FOR_STARGAL = TRUE;
+  }
 
   UPDATE = FALSE;
Index: /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/bcatalog.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/bcatalog.c	(revision 42266)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/bcatalog.c	(revision 42267)
@@ -82,15 +82,17 @@
       if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { Ndophot ++; continue; }
 
+      float Maper = USE_APER_FOR_STARGAL ? catalog[0].measure[offset].Map : catalog[0].measure[offset].Mkron;
+
       // skip garbage measurements
       if (isnan(catalog[0].measure[offset].psfQF)     || (catalog[0].measure[offset].psfQF < 0.95))     { Npsfqf ++; continue; }
       if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < 0.95)) { Npsfqf ++; continue; }
       if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }
-      if (isnan(catalog[0].measure[offset].Mkron)) { Nnan ++; continue; }
+      if (isnan(Maper)) { Nnan ++; continue; }
 
       // require 0x01 in photFlags (fitted with a PSF) -- add to the test data
       if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }
 
-      // very loose cut on PSF - Kron 
-      float Mkp = catalog[0].measure[offset].M - catalog[0].measure[offset].Mkron;
+      // very loose cut on PSF - APER mag (Map or Mkron) -- this lightly rejects galaxies & other oddities
+      float Mkp = catalog[0].measure[offset].M - Maper;
       if (fabs(Mkp) > 1.0) { Nbad ++; continue; }
 
@@ -101,11 +103,9 @@
       if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;}
 
-      // check for galaxies (XXX skip for now)
-      if (FALSE && !isnan(catalog[0].measure[offset].Map)) {
-	if (catalog[0].measure[offset].M - catalog[0].measure[offset].Map > 0.15) {
-	  nEXT ++;
-	} else {
-	  nPSF ++;
-	}
+      // weak test for galaxies
+      if (Mkp > 0.5) {
+	nEXT ++;
+      } else {
+	nPSF ++;
       }
 
@@ -145,5 +145,5 @@
 
     // skip object if it is likely to be a galaxy
-    if (FALSE && (nEXT >= nPSF)) {
+    if (nEXT >= nPSF) {
       Nmeasure -= Nm;
       Ngalaxy ++;
