Index: /trunk/Ohana/src/addstar/src/find_matches_ICRF.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_ICRF.c	(revision 39376)
+++ /trunk/Ohana/src/addstar/src/find_matches_ICRF.c	(revision 39377)
@@ -140,5 +140,5 @@
     catalog[0].measure[Nmeas].catID    = catID;
 
-    catalog[0].average[n].flags |= ID_ICRF_QSO;
+    catalog[0].average[n].flags |= ID_OBJ_ICRF_QSO;
 
     stars[N].found = TRUE;
Index: /trunk/Ohana/src/libdvo/include/dvo.h
===================================================================
--- /trunk/Ohana/src/libdvo/include/dvo.h	(revision 39376)
+++ /trunk/Ohana/src/libdvo/include/dvo.h	(revision 39377)
@@ -172,31 +172,37 @@
 /* Average.flags values -- these values are 32 bit (as of PS1_V1) */
 typedef enum {
-  ID_STAR_FEW          = 0x00000001, // used within relphot: skip star
-  ID_STAR_POOR         = 0x00000002, // used within relphot: skip star
-  ID_ICRF_QSO          = 0x00000004, // object IDed with known ICRF quasar (may have ICRF position measurement)
-  ID_OTHEF_QSO         = 0x00000008, // object IDed with known or suspected quasar, without ICRF reference data
-  ID_PROPER            = 0x00000010, // star with large proper motion
-  ID_TRANSIENT         = 0x00000020, // identified as a non-periodic (stationary) transient
-  ID_VARIABLE          = 0x00000040, // identified as a periodic variable
-  ID_ASTEROID          = 0x00000080, // identified with a known solar-system object (asteroid or other)
-  ID_STACK_ASTROM      = 0x00000100, // stack position used for astrometry
-  
-  // bits 0x00000200 - 0x00008000 are currently unused
-  ID_OBJ_BEST_STACK    = 0x00008000, // the primary stack measurement are the best measurements
-  ID_STAR_FIT_AVE      = 0x00010000, // average position fitted
-  ID_STAR_FIT_PM       = 0x00020000, // proper motion fitted
-  ID_STAR_FIT_PAR      = 0x00040000, // parallax fitted
-  ID_STAR_USE_AVE      = 0x00080000, // average position used (not PM or PAR)
-  ID_STAR_USE_PM       = 0x00100000, // proper motion used (not AVE or PAR)
-  ID_STAR_USE_PAR      = 0x00200000, // parallax used (not AVE or PM)
-  ID_STAR_NO_ASTROM    = 0x00400000, // mean astrometry could not be measured
-  ID_STAR_BAD_PM       = 0x00800000, // mean astrometry could not be measured
-  ID_OBJ_EXT           = 0x01000000, // extended in our data (eg, PS)
-  ID_OBJ_EXT_ALT       = 0x02000000, // extended in external data (eg, 2MASS)
-  ID_OBJ_GOOD          = 0x04000000, // good-quality measurement in our data (eg,PS)
-  ID_OBJ_GOOD_ALT      = 0x08000000, // good-quality measurement in  external data (eg, 2MASS)
-  ID_OBJ_GOOD_STACK    = 0x10000000, // good-quality object in the stack (> 1 good stack)
-  ID_OBJ_SUSPECT_STACK = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
-  ID_OBJ_BAD_STACK     = 0x40000000, // good-quality object in the stack (> 1 good stack)
+  ID_OBJ_FEW             = 0x00000001, // used within relphot: skip star
+  ID_OBJ_POOR            = 0x00000002, // used within relphot: skip star
+  // NOTE: bits used for object classification:
+  ID_OBJ_ICRF_QSO        = 0x00000004, // object IDed with known ICRF quasar (may have ICRF position measurement)
+  ID_OBJ_OTHEF_QSO       = 0x00000008, // identified as likely QSO (Hernitschek et al 2015), without ICRF reference data
+  ID_OBJ_TRANSIENT       = 0x00000010, // identified as a non-periodic (stationary) transient
+  ID_OBJ_VARIABLE        = 0x00000020, // identified as a periodic variable
+  ID_OBJ_RRLYRA          = 0x00000040, // identified as likely RR Lyra (Hernitschek et al 2015)
+  ID_OBJ_HAS_SOLSYS_DET  = 0x00000080, // identified with a known solar-system object (asteroid or other)
+  ID_OBJ_ALL_SOLSYS_DET  = 0x00000100, // identified with a known solar-system object (asteroid or other)
+  // bits 0x00000200 - 0x00000400 are currently unused
+  // NOTE: bits used for astrometry analysis
+  ID_OBJ_LARGE_PM        = 0x00000800, // star with large proper motion
+  ID_OBJ_RAW_AVE      	 = 0x00001000, // simple weighted average position was used (no IRLS fitting)
+  ID_OBJ_FIT_AVE      	 = 0x00002000, // average position was fitted
+  ID_OBJ_FIT_PM       	 = 0x00004000, // proper motion model was fitted
+  ID_OBJ_FIT_PAR      	 = 0x00008000, // parallax model was fitted
+  ID_OBJ_USE_AVE      	 = 0x00010000, // average position used (not PM or PAR)
+  ID_OBJ_USE_PM       	 = 0x00020000, // proper motion used (not AVE or PAR)
+  ID_OBJ_USE_PAR      	 = 0x00040000, // parallax used (not AVE or PM)
+  ID_OBJ_NO_MEAN_ASTROM  = 0x00080000, // mean astrometry could not be measured
+  ID_OBJ_STACK_FOR_MEAN  = 0x00100000, // stack position used for mean astrometry
+  ID_OBJ_MEAN_FOR_STACK  = 0x00200000, // mean astrometry could not be measured
+  ID_OBJ_BAD_PM          = 0x00400000, // failure to measure proper-motion model
+  // NOTE: bits used for photometry analysis
+  ID_OBJ_EXT             = 0x00800000, // extended in our data (eg, PS)
+  ID_OBJ_EXT_ALT         = 0x01000000, // extended in external data (eg, 2MASS)
+  ID_OBJ_GOOD            = 0x02000000, // good-quality measurement in our data (eg,PS)
+  ID_OBJ_GOOD_ALT        = 0x04000000, // good-quality measurement in  external data (eg, 2MASS)
+  ID_OBJ_GOOD_STACK      = 0x08000000, // good-quality object in the stack (> 1 good stack)
+  ID_OBJ_BEST_STACK      = 0x10000000, // the primary stack measurement are the best measurements
+  ID_OBJ_SUSPECT_STACK   = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
+  ID_OBJ_BAD_STACK       = 0x40000000, // good-quality object in the stack (> 1 good stack)
 } DVOAverageFlags;
 
Index: /trunk/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 39377)
@@ -772,5 +772,5 @@
   if (PoorImages) {
     IMAGE_BAD = ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_SKIP;
-    STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+    STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
     MEAS_BAD  = ID_MEAS_NOCAL | ID_MEAS_POOR_PHOTOM | ID_MEAS_SKIP_PHOTOM | ID_MEAS_AREA;
   }
Index: /trunk/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/MosaicOps.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/MosaicOps.c	(revision 39377)
@@ -1036,5 +1036,5 @@
   if (PoorImages) {
     IMAGE_BAD = ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_SKIP;
-    STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+    STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
     MEAS_BAD  = ID_MEAS_NOCAL | ID_MEAS_POOR_PHOTOM | ID_MEAS_SKIP_PHOTOM | ID_MEAS_AREA;
   }
@@ -1351,5 +1351,5 @@
   if (PoorImages) {
     IMAGE_BAD = ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_SKIP;
-    STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+    STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
     MEAS_BAD  = ID_MEAS_NOCAL | ID_MEAS_POOR_PHOTOM | ID_MEAS_SKIP_PHOTOM | ID_MEAS_AREA;
   }
Index: /trunk/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/StarOps.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/StarOps.c	(revision 39377)
@@ -756,5 +756,5 @@
       if (N < Nminmeas) { /* too few measurements */
 	// fprintf (f, "%10.6f %10.6f %d %d %d\n", catalog[Nc].averageT[j].R, catalog[Nc].averageT[j].D, catalog[Nc].measureT[catalog[Nc].averageT[j].measureOffset].imageID, N, STAR_TOOFEW); 
-	catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags |= ID_STAR_FEW;
+	catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags |= ID_OBJ_FEW;
 	if (Ncode == 0) {
 	  results->Ncode ++;
@@ -764,5 +764,5 @@
 	continue;
       } else {
-	catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags &= ~ID_STAR_FEW;
+	catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags &= ~ID_OBJ_FEW;
       }	
 
@@ -1108,5 +1108,5 @@
 	mark = (dM > MaxScatter) || (isnan(Mchisq)) || (Mchisq > MaxChisq);
 	if (mark) {
-	  catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_STAR_POOR;
+	  catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_OBJ_POOR;
 	  Ndel ++;
 	  if (dM > MaxScatter)   { Nscat ++; }
@@ -1114,5 +1114,5 @@
 	  if (Mchisq > MaxChisq) { Nchi ++; }
 	} else {
-	  catalog[i].secfilt[Nsecfilt*j+Nsec].flags &= ~ID_STAR_POOR;
+	  catalog[i].secfilt[Nsecfilt*j+Nsec].flags &= ~ID_OBJ_POOR;
 	}
 	Nave ++;
Index: /trunk/Ohana/src/relphot/src/initialize.c
===================================================================
--- /trunk/Ohana/src/relphot/src/initialize.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/initialize.c	(revision 39377)
@@ -32,5 +32,5 @@
 
   IMAGE_BAD = ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_SKIP;
-  STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+  STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
   MEAS_BAD  = ID_MEAS_NOCAL | ID_MEAS_POOR_PHOTOM | ID_MEAS_SKIP_PHOTOM | ID_MEAS_AREA;
 
Index: /trunk/Ohana/src/relphot/src/relphot_images.c
===================================================================
--- /trunk/Ohana/src/relphot/src/relphot_images.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/relphot_images.c	(revision 39377)
@@ -90,15 +90,15 @@
       int star_toofew;
 
-      // until we finish the grid analysis, do not reject stars out-of-hand based on ID_STAR_FEW
+      // until we finish the grid analysis, do not reject stars out-of-hand based on ID_OBJ_FEW
       // XXX this is kind of poor: need to have a better distinctions about STAR_BAD in setMrel vs getMrel
       star_toofew = STAR_TOOFEW;
       STAR_TOOFEW = 0;
       for (i = 0; i < NGRID; i++) {
-	STAR_BAD = ID_STAR_POOR;
+	STAR_BAD = ID_OBJ_POOR;
 	setMrel  (catalog, Ncatalog, flatcorr);
-	STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+	STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
 	setMgrid (catalog, flatcorr);
       }
-      STAR_BAD  = ID_STAR_POOR | ID_STAR_FEW;
+      STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
       STAR_TOOFEW = star_toofew;
     }
Index: /trunk/Ohana/src/relphot/src/relphot_objects.c
===================================================================
--- /trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 39377)
@@ -63,15 +63,16 @@
       Nsecfilt = catalog.Nsecfilt;
 
-      DVOAverageFlags astromBits = 
-	ID_STAR_FIT_AVE   | 
-	ID_STAR_FIT_PM    | 
-	ID_STAR_FIT_PAR   | 
-	ID_STAR_USE_AVE   | 
-	ID_STAR_USE_PM    | 
-	ID_STAR_USE_PAR   |
-	ID_STAR_NO_ASTROM ; 
+      DVOAverageFlags photomBits = 
+	ID_OBJ_EXT             | // extended in our data (eg, PS)
+	ID_OBJ_EXT_ALT         | // extended in external data (eg, 2MASS)
+	ID_OBJ_GOOD            | // good-quality measurement in our data (eg,PS)
+	ID_OBJ_GOOD_ALT        | // good-quality measurement in  external data (eg, 2MASS)
+	ID_OBJ_GOOD_STACK      | // good-quality object in the stack (> 1 good stack)
+	ID_OBJ_BEST_STACK      | // the primary stack measurement are the best measurements
+	ID_OBJ_SUSPECT_STACK   | // suspect object in the stack (> 1 good or suspect stack, < 2 good)
+	ID_OBJ_BAD_STACK;        // good-quality object in the stack (> 1 good stack)
       
       for (j = 0; j < catalog.Naverage; j++) {
-	catalog.average[j].flags &= astromBits; // reset all except astrometry bits
+	catalog.average[j].flags &= ~photomBits; // reset all except astrometry bits
 	catalog.average[j].psfQF     = NAN;     // reset (will be re-calculated here)
 	catalog.average[j].psfQFperf = NAN;	// reset (will be re-calculated here)
Index: /trunk/Ohana/src/relphot/src/setMrelCatalog.c
===================================================================
--- /trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39377)
@@ -351,5 +351,5 @@
     int Nranking = magStatsByRanking (&results->psfData[Nsec], psfstats);
     if (Nranking < Nminmeas) { 
-      secfilt[Nsec].flags |= ID_STAR_FEW;
+      secfilt[Nsec].flags |= ID_OBJ_FEW;
     } else {
       secfilt[Nsec].M  	 = psfstats->mean;
Index: /trunk/Ohana/src/relphot/src/setMrelFinal.c
===================================================================
--- /trunk/Ohana/src/relphot/src/setMrelFinal.c	(revision 39376)
+++ /trunk/Ohana/src/relphot/src/setMrelFinal.c	(revision 39377)
@@ -104,14 +104,14 @@
   if (!simpleAverage) setMcalOutput (catalog, 1, flatcorr);
 
-  /* clear ID_STAR_POOR, ID_STAR_FEW values before writing ??? */
+  /* clear ID_OBJ_POOR, ID_OBJ_FEW values before writing ??? */
   /* ID_MEAS_NOCAL is an internal bit, so it should be cleared */
   // XXX eventually: move these internal flags to an internal-only catalog->FOO element (like found)
   for (i = 0; i < catalog[0].Naverage; i++) {
-    catalog[0].average[i].flags &= ~ID_STAR_FEW;
-    catalog[0].average[i].flags &= ~ID_STAR_POOR;
+    catalog[0].average[i].flags &= ~ID_OBJ_FEW;
+    catalog[0].average[i].flags &= ~ID_OBJ_POOR;
     off_t j;
     for (j = 0; j < Nsecfilt; j++) {
-	catalog[0].secfilt[i*Nsecfilt+j].flags &= ~ID_STAR_FEW; 
-	catalog[0].secfilt[i*Nsecfilt+j].flags &= ~ID_STAR_POOR; 
+	catalog[0].secfilt[i*Nsecfilt+j].flags &= ~ID_OBJ_FEW; 
+	catalog[0].secfilt[i*Nsecfilt+j].flags &= ~ID_OBJ_POOR; 
     }
     off_t m = catalog[0].average[i].measureOffset;
