Index: trunk/Ohana/src/libdvo/include/convert.h
===================================================================
--- trunk/Ohana/src/libdvo/include/convert.h	(revision 39520)
+++ trunk/Ohana/src/libdvo/include/convert.h	(revision 39521)
@@ -10,4 +10,5 @@
 time_t        TimeRef               PROTO((double time, time_t TimeReference, int TimeFormat));
 double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
+double        TimeRange             PROTO((time_t time, int TimeFormat));
 
 int           hh_hms                PROTO((double hh, int *hr, int *mn, double *sc));
Index: trunk/Ohana/src/libdvo/include/dvo.h
===================================================================
--- trunk/Ohana/src/libdvo/include/dvo.h	(revision 39520)
+++ trunk/Ohana/src/libdvo/include/dvo.h	(revision 39521)
@@ -174,13 +174,16 @@
   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
+  ID_OBJ_HERN_QSO_P60    = 0x00000008, // identified as likely QSO (Hernitschek et al 2015), P_QSO = 0.60
+  ID_OBJ_HERN_QSO_P05    = 0x00000010, // identified as possible QSO (Hernitschek et al 2015), P_QSO = 0.05
+  ID_OBJ_HERN_RRL_P60    = 0x00000020, // identified as likely  RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.60
+  ID_OBJ_HERN_RRL_P05    = 0x00000040, // identified as possible RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.05
+  ID_OBJ_HERN_VARIABLE   = 0x00000080, // identified as a variable based on ChiSq (Hernitschek et al 2015)
+  ID_OBJ_TRANSIENT       = 0x00000100, // identified as a non-periodic (stationary) transient
+  ID_OBJ_HAS_SOLSYS_DET  = 0x00000200, // identified with a known solar-system object (asteroid or other)
+  ID_OBJ_MOST_SOLSYS_DET = 0x00000400, // most detections from a known solar-system object
+
   // NOTE: bits used for astrometry analysis
   ID_OBJ_LARGE_PM        = 0x00000800, // star with large proper motion
@@ -196,4 +199,5 @@
   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)
Index: trunk/Ohana/src/libdvo/include/dvodb.h
===================================================================
--- trunk/Ohana/src/libdvo/include/dvodb.h	(revision 39520)
+++ trunk/Ohana/src/libdvo/include/dvodb.h	(revision 39521)
@@ -491,5 +491,6 @@
 int           GetTimeSelection      PROTO((time_t *tz, time_t *te));
 int           GetTimeFormat         PROTO((time_t *TimeReference, int *TimeFormat));
-double        TimeValue (time_t time, time_t TimeReference, int TimeFormat);
+double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
+double        TimeRange             PROTO((time_t time, int TimeFormat));
 
 void          image_subset          PROTO((Image *image, off_t Nimage, off_t **Subset, off_t *Nsubset, SkyRegionSelection *selection, e_time tzero, double trange, int TimeSelect));
Index: trunk/Ohana/src/libdvo/src/convert.c
===================================================================
--- trunk/Ohana/src/libdvo/src/convert.c	(revision 39520)
+++ trunk/Ohana/src/libdvo/src/convert.c	(revision 39521)
@@ -261,4 +261,29 @@
 }
   
+/* convert UNIX time (sec) range to a time range in the given unit */
+double TimeRange (time_t dt, int TimeFormat) {
+
+  double value;
+
+  switch (TimeFormat) {
+  case TIME_JD:
+  case TIME_MJD:
+  case TIME_DAYS:
+    value = dt / 86400.0;
+    break;
+  case TIME_HOURS:
+    value = dt / 3600.0;
+    break;
+  case TIME_MINUTES:
+    value = dt / 60.0;
+    break;
+  case TIME_SECONDS:
+  default:
+    value = dt;
+    break;
+  }
+  return (value);
+}
+  
 /* convert time value referenced to the TimeReference in the given unit to UNIX time */
 time_t TimeRef (double value, time_t TimeReference, int TimeFormat) {
Index: trunk/Ohana/src/libdvo/src/dbExtractAverages.c
===================================================================
--- trunk/Ohana/src/libdvo/src/dbExtractAverages.c	(revision 39520)
+++ trunk/Ohana/src/libdvo/src/dbExtractAverages.c	(revision 39521)
@@ -165,5 +165,5 @@
       break;
     case AVE_TRANGE:
-      value.Flt = TimeValue (average[0].Trange, 0, TimeFormat);
+      value.Flt = TimeRange (average[0].Trange, TimeFormat);
       break;
 
Index: trunk/Ohana/src/libdvo/src/dbExtractMeasures.c
===================================================================
--- trunk/Ohana/src/libdvo/src/dbExtractMeasures.c	(revision 39520)
+++ trunk/Ohana/src/libdvo/src/dbExtractMeasures.c	(revision 39521)
@@ -411,5 +411,5 @@
       break;
     case MEAS_TMEAN: /* OK */
-      value.Flt = TimeValue (average[0].Tmean, TimeReference, TimeFormat);
+      value.Flt = TimeRange (average[0].Trange, TimeFormat);
       break;
     case MEAS_TRANGE: /* OK */
