Index: /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode-ps1-v3.d
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode-ps1-v3.d	(revision 33407)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode-ps1-v3.d	(revision 33408)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_PHOTCODE_PS1_V3
 TYPE         BINTABLE
-SIZE         104
+SIZE         112
 DESCRIPTION  DVO Photcode Description Table 
 
@@ -22,9 +22,9 @@
 FIELD  astromErrScale,    ASTROM_ERR_SCALE,  	 float,          astrometric error scale
 FIELD  astromErrMagScale, ASTROM_ERR_MAG_SCALE,  float,          astrometric error / mag error scale
-FIELD  astromPoorMask,    ASTROM_POOR_MASK,      short,          detections matching this mask should only be used in emergencies
-FIELD  astromBadMask,     ASTROM_BAD_MASK,       short,          detections matching this mask should not be used
+FIELD  astromPoorMask,    ASTROM_POOR_MASK,      int,            detections matching this mask should only be used in emergencies
+FIELD  astromBadMask,     ASTROM_BAD_MASK,       int,            detections matching this mask should not be used
 FIELD  photomErrSys,   	  PHOTOM_ERR_SYS,  	 float,          systematic photometric error
-FIELD  photomPoorMask, 	  PHOTOM_POOR_MASK,  	 short,          detections matching this mask should only be used in emergencies
-FIELD  photomBadMask,  	  PHOTOM_BAD_MASK,  	 short,          detections matching this mask should not be used
+FIELD  photomPoorMask, 	  PHOTOM_POOR_MASK,  	 int,            detections matching this mask should only be used in emergencies
+FIELD  photomBadMask,  	  PHOTOM_BAD_MASK,  	 int,            detections matching this mask should not be used
 
 #   dR_total^2 =  dR_sys^2 + AS * dR_obs^2 + MS * dM_obs^2
Index: /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode.d
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode.d	(revision 33407)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/photcode.d	(revision 33408)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_PHOTCODE_RAW
 TYPE         BINTABLE
-SIZE         104
+SIZE         112
 DESCRIPTION  DVO Photcode Description Table 
 
@@ -22,9 +22,9 @@
 FIELD  astromErrScale,    ASTROM_ERR_SCALE,  	 float,          astrometric error scale
 FIELD  astromErrMagScale, ASTROM_ERR_MAG_SCALE,  float,          astrometric error / mag error scale
-FIELD  astromPoorMask,    ASTROM_POOR_MASK,      short,          detections matching this mask should only be used in emergencies
-FIELD  astromBadMask,     ASTROM_BAD_MASK,       short,          detections matching this mask should not be used
+FIELD  astromPoorMask,    ASTROM_POOR_MASK,      int,            detections matching this mask should only be used in emergencies
+FIELD  astromBadMask,     ASTROM_BAD_MASK,       int,            detections matching this mask should not be used
 FIELD  photomErrSys,   	  PHOTOM_ERR_SYS,  	 float,          systematic photometric error
-FIELD  photomPoorMask, 	  PHOTOM_POOR_MASK,  	 short,          detections matching this mask should only be used in emergencies
-FIELD  photomBadMask,  	  PHOTOM_BAD_MASK,  	 short,          detections matching this mask should not be used
+FIELD  photomPoorMask, 	  PHOTOM_POOR_MASK,  	 int,            detections matching this mask should only be used in emergencies
+FIELD  photomBadMask,  	  PHOTOM_BAD_MASK,  	 int,            detections matching this mask should not be used
 
 #   dR_total^2 =  dR_sys^2 + AS * dR_obs^2 + MS * dM_obs^2
Index: /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c	(revision 33407)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c	(revision 33408)
@@ -257,4 +257,5 @@
     gfits_define_bintable_column (&theader, "J", "IMAGE_ID", "image",                       NULL,    1.0, 1.0*0x8000);
     gfits_define_bintable_column (&theader, "J", "DB_FLAGS", "flags",                       NULL,    1.0, 1.0*0x8000);
+    gfits_define_bintable_column (&theader, "J", "PHOT_FLAGS", "photflags",                 NULL,    1.0, 1.0*0x8000);
     gfits_define_bintable_column (&theader, "J", "CAT_ID",   "catalog",                     NULL,    1.0, 1.0*0x8000);
     gfits_define_bintable_column (&theader, "I", "PHOTCODE", "photcode",                    NULL,    1.0, 1.0*0x80);
Index: /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c	(revision 33407)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c	(revision 33408)
@@ -670,5 +670,4 @@
 	  float mySigma = hypot (stats.sigma, dlist[k]);
 	  if (fabs (list[k] - stats.median) > NSIGMA_REJECT*mySigma) {
-	    // fprintf (f, "%10.6f %10.6f %d %f %f %f %f 0x%08x\n", catalog[i].averageT[j].R, catalog[i].averageT[j].D, catalog[i].measureT[ilist[k]].imageID, list[k], stats.median, stats.sigma, mySigma, catalog[i].measureT[ilist[k]].photFlags); 
 	    catalog[i].measureT[ilist[k]].dbFlags |= ID_MEAS_POOR_PHOTOM;
 	    if (final) {
@@ -677,8 +676,4 @@
 	    }
 	    Ndel ++;
-	  } else {
-	    if (catalog[i].measureT[ilist[k]].photFlags & 0x02) {
-	      fprintf (stderr, "failed to mark %10.6f %10.6f %d\n", catalog[i].averageT[j].R, catalog[i].averageT[j].D, catalog[i].measureT[ilist[k]].imageID);
-	    }
 	  }
 	}
Index: /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c	(revision 33407)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c	(revision 33408)
@@ -130,9 +130,12 @@
       if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }
 
-      if (catalog[0].measure[offset].photFlags & code->photomBadMask) { Nbad++; continue;}
+      if (catalog[0].measure[offset].photFlags & code->photomBadMask) { 
+	Nbad++; 
+	continue;
+      }
       if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;}
 
-      // check for galaxies
-      if (!isnan(catalog[0].measure[offset].Map)) {
+      // 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 ++;
@@ -175,5 +178,5 @@
 
     // skip object if it is likely to be a galaxy
-    if (nEXT >= nPSF) {
+    if (FALSE && (nEXT >= nPSF)) {
       Nmeasure -= Nm;
       Ngalaxy ++;
