Index: trunk/Ohana/src/libdvo/include/dvo.h
===================================================================
--- trunk/Ohana/src/libdvo/include/dvo.h	(revision 27484)
+++ trunk/Ohana/src/libdvo/include/dvo.h	(revision 27580)
@@ -21,4 +21,5 @@
   DVO_FORMAT_PS1_DEV_3,
   DVO_FORMAT_PS1_V1,
+  DVO_FORMAT_PS1_V2,
   DVO_FORMAT_PS1_REF
 } DVOTableFormat;
@@ -91,22 +92,23 @@
 # define ID_IMAGE_FEW   0x0008  /* currently too few measurements for good value */
 
-/* Measure.flags values */
-// XXX replace the # defines with typedef enum
-# define ID_MEAS_NOCAL        0x0001  /* detection ignored for this analysis (photcode, time range) -- internal only */
-# define ID_MEAS_POOR_PHOTOM  0x0002  /* detection is photometry outlier					     */	  
-# define ID_MEAS_SKIP_PHOTOM  0x0004  /* detection was ignored for photometry measurement			     */	  
-# define ID_MEAS_AREA         0x0008  /* detection near image edge						     */
-# define ID_MEAS_POOR_ASTROM  0x0010  /* detection is astrometry outlier					     */	  
-# define ID_MEAS_SKIP_ASTROM  0x0020  /* detection was ignored for astrometry measurement			     */	  
-# define ID_MEAS_USED_OBJ     0x0040  /* detection was used during opdate objects				     */
-# define ID_MEAS_USED_CHIP    0x0080  /* detection was used during update chips					     */
-# define ID_MEAS_BLEND_MEAS   0x0100  /* detection is within radius of multiple objects				     */
-# define ID_MEAS_BLEND_OBJ    0x0200  /* multiple detections within radius of object				     */
-# define ID_MEAS_UNDEF_3      0x0400  /* unused									     */
-# define ID_MEAS_UNDEF_4      0x0800  /* unused									     */
-# define ID_MEAS_BLEND_MEAS_X 0x1000  /* detection is within radius of multiple objects across catalogs		     */
-# define ID_MEAS_ARTIFACT     0x2000  /* detection is thought to be non-astronomical				     */
-# define ID_MEAS_UNDEF_5      0x4000  /* unused									     */
-# define ID_MEAS_UNDEF_6      0x8000  /* unused									     */
+/* Measure.flags values -- these values are 32 bit (as of PS1_V1) */
+typedef enum {
+  ID_MEAS_NOCAL        = 0x0001,  // detection ignored for this analysis (photcode, time range) -- internal only 
+  ID_MEAS_POOR_PHOTOM  = 0x0002,  // detection is photometry outlier					     	  
+  ID_MEAS_SKIP_PHOTOM  = 0x0004,  // detection was ignored for photometry measurement			     	  
+  ID_MEAS_AREA         = 0x0008,  // detection near image edge						     
+  ID_MEAS_POOR_ASTROM  = 0x0010,  // detection is astrometry outlier					     	  
+  ID_MEAS_SKIP_ASTROM  = 0x0020,  // detection was ignored for astrometry measurement			     	  
+  ID_MEAS_USED_OBJ     = 0x0040,  // detection was used during opdate objects				     
+  ID_MEAS_USED_CHIP    = 0x0080,  // detection was used during update chips					     
+  ID_MEAS_BLEND_MEAS   = 0x0100,  // detection is within radius of multiple objects				     
+  ID_MEAS_BLEND_OBJ    = 0x0200,  // multiple detections within radius of object				     
+  ID_MEAS_UNDEF_3      = 0x0400,  // unused									     
+  ID_MEAS_UNDEF_4      = 0x0800,  // unused									     
+  ID_MEAS_BLEND_MEAS_X = 0x1000,  // detection is within radius of multiple objects across catalogs		     
+  ID_MEAS_ARTIFACT     = 0x2000,  // detection is thought to be non-astronomical				     
+  ID_MEAS_UNDEF_5      = 0x4000,  // unused									     
+  ID_MEAS_UNDEF_6      = 0x8000,  // unused									     
+} DVOMeasureFlags;
 
 // XXX we used these names previously in markstar: replace with ID_MEAS_ARTIFACT
@@ -124,18 +126,26 @@
 */
 
-/* Average.code values */
-# define ID_STAR_FEW   0x0001 /* used within relphot: skip star */
-# define ID_STAR_POOR  0x0002 /* used within relphot: skip star */
-# define ID_PROPER     0x0400 /* star with large proper motion */
-# define ID_TRANSIENT  0x1000 /* is this mutually exclusive with USNO?  */
-# define ID_VARIABLE   0x2000 /* not currently set? */
-# define ID_ASTEROID   0x2000 /* identified with an asteroid */
-# define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */
-# define ID_MOVING     0x8000
-# define ID_ROCK       0xa000 /* 0x8000 + 0x2000 */
-# define ID_GHOST      0xc001 /* 0x8000 + 0x4000 + 0x0001 */
-# define ID_TRAIL      0xc002 /* 0x8000 + 0x4000 + 0x0002 */
-# define ID_BLEED      0xc003 /* 0x8000 + 0x4000 + 0x0003 */ 
-# define ID_COSMIC     0xc004 /* 0x8000 + 0x4000 + 0x0004 */ 
+/* Average.code 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_PROPER       = 0x00000400, // star with large proper motion 
+  ID_TRANSIENT    = 0x00001000, // is this mutually exclusive with USNO?  
+  ID_VARIABLE     = 0x00002000, // not currently set? 
+  ID_ASTEROID     = 0x00002000, // identified with an asteroid 
+  ID_BAD_OBJECT   = 0x00004000, // if all measurements are bad, set this bit 
+  ID_MOVING       = 0x00008000, // is a moving object
+  ID_ROCK         = 0x0000a000, // 0x8000 + 0x2000 
+  ID_GHOST        = 0x0000c001, // 0x8000 + 0x4000 + 0x0001 
+  ID_TRAIL        = 0x0000c002, // 0x8000 + 0x4000 + 0x0002 
+  ID_BLEED        = 0x0000c003, // 0x8000 + 0x4000 + 0x0003  
+  ID_COSMIC       = 0x0000c004, // 0x8000 + 0x4000 + 0x0004  
+  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)
+} DVOAverageFlags;
 
 /*** general dvo structures (internal use only / not IO) ***/
@@ -389,4 +399,5 @@
 # include "ps1_dev_3_defs.h"
 # include "ps1_v1_defs.h"
+# include "ps1_v2_defs.h"
 # include "ps1_ref_defs.h"
 
