Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/Makefile.Targets
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/Makefile.Targets	(revision 38739)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/Makefile.Targets	(revision 38740)
@@ -56,5 +56,6 @@
 $(ASRC)/starpar-ps1-sim.$(ARCH).o \
 $(ASRC)/galphot.$(ARCH).o \
-$(ASRC)/galphot-ps1-v5.$(ARCH).o \
+$(ASRC)/galphot-ps1-v5-r0.$(ARCH).o \
+$(ASRC)/galphot-ps1-v5-r1.$(ARCH).o \
 $(ASRC)/missing.$(ARCH).o \
 $(ASRC)/photcode.$(ARCH).o \
@@ -168,5 +169,6 @@
 $(AINC)/starpar-ps1-sim.h \
 $(AINC)/galphot.h \
-$(AINC)/galphot-ps1-v5.h \
+$(AINC)/galphot-ps1-v5-r0.h \
+$(AINC)/galphot-ps1-v5-r1.h \
 $(AINC)/missing.h \
 $(AINC)/photcode.h \
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r0.d
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r0.d	(revision 38740)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r0.d	(revision 38740)
@@ -0,0 +1,28 @@
+STRUCT       GalPhot_PS1_V5_R0
+EXTNAME      DVO_GALPHOT_PS1_V5
+TYPE         BINTABLE
+SIZE         72
+DESCRIPTION  DVO Galaxy Shape Table 
+
+FIELD Xfit,         XFIT,    	    float,          centroid for fit
+FIELD Yfit,         YFIT,    	    float,          centroid for fit
+FIELD mag,          MAG,    	    float,          galaxy magnitude
+FIELD magErr,       MAG_ERR,	    float,          galaxy magnitude error
+FIELD majorAxis,    MAJOR_AXIS,     float,          major axis size
+FIELD minorAxis,    MINOR_AXIS,     float,          minor axis size
+FIELD majorAxisErr, MAJOR_AXIS_ERR, float,          major axis size error
+FIELD minorAxisErr, MINOR_AXIS_ERR, float,          minor axis size error
+FIELD theta,        THETA,          float,          angle
+FIELD thetaErr,     THETA_ERR,      float,          angle error
+FIELD index,        INDEX,          float,          sersic index (if relevant)
+FIELD chisq,        CHISQ,   	    float,          fit chisq
+		    
+FIELD Npix,         NPIX,           float,          fitted pixels
+
+FIELD objID,        OBJ_ID,         unsigned int,   unique ID for object in table
+FIELD catID,        CAT_ID,         unsigned int,   unique ID for table in which object was first realized
+FIELD detID,        DET_ID,         unsigned int,   detection ID
+FIELD imageID,      IMAGE_ID,       unsigned int,   reference to DVO image ID
+
+FIELD photcode,     PHOTCODE,       short
+FIELD modelType,    MODEL_TYPE,     short,          mean lensing smear object E2
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r1.d
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r1.d	(revision 38740)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/galphot-ps1-v5-r1.d	(revision 38740)
@@ -0,0 +1,31 @@
+STRUCT       GalPhot_PS1_V5_R1
+EXTNAME      DVO_GALPHOT_PS1_V5
+TYPE         BINTABLE
+SIZE         80
+DESCRIPTION  DVO Galaxy Shape Table 
+
+FIELD Xfit,         XFIT,    	    float,          centroid for fit
+FIELD Yfit,         YFIT,    	    float,          centroid for fit
+FIELD mag,          MAG,    	    float,          galaxy magnitude
+FIELD magErr,       MAG_ERR,	    float,          galaxy magnitude error
+FIELD majorAxis,    MAJOR_AXIS,     float,          major axis size
+FIELD minorAxis,    MINOR_AXIS,     float,          minor axis size
+FIELD majorAxisErr, MAJOR_AXIS_ERR, float,          major axis size error
+FIELD minorAxisErr, MINOR_AXIS_ERR, float,          minor axis size error
+FIELD theta,        THETA,          float,          angle
+FIELD thetaErr,     THETA_ERR,      float,          angle error
+FIELD index,        INDEX,          float,          sersic index (if relevant)
+FIELD chisq,        CHISQ,   	    float,          fit chisq
+		    
+FIELD Npix,         NPIX,           float,          fitted pixels
+
+FIELD objID,        OBJ_ID,         unsigned int,   unique ID for object in table
+FIELD catID,        CAT_ID,         unsigned int,   unique ID for table in which object was first realized
+FIELD detID,        DET_ID,         unsigned int,   detection ID
+FIELD imageID,      IMAGE_ID,       unsigned int,   reference to DVO image ID
+
+FIELD averef,       AVEREF,         unsigned int,   reference to average table
+FIELD dummy,        DUMMY,          unsigned int,   filler
+
+FIELD photcode,     PHOTCODE,       short
+FIELD modelType,    MODEL_TYPE,     short,          mean lensing smear object E2
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/include/ps1_v5_defs.h
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/include/ps1_v5_defs.h	(revision 38739)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/include/ps1_v5_defs.h	(revision 38740)
@@ -23,6 +23,8 @@
 StarPar_PS1_V5          *StarParInternalTo_PS1_V5 (StarPar *in, off_t Nvalues);
 
-GalPhot 	       	*GalPhot_PS1_V5_ToInternal (GalPhot_PS1_V5 *in, off_t Nvalues);
-GalPhot_PS1_V5         *GalPhotInternalTo_PS1_V5 (GalPhot *in, off_t Nvalues);
+GalPhot 	       	*GalPhot_PS1_V5_R1_ToInternal (GalPhot_PS1_V5_R1 *in, off_t Nvalues);
+GalPhot                 *GalPhot_PS1_V5_R0_ToInternal (GalPhot_PS1_V5_R0 *in, off_t Nvalues);
+
+GalPhot_PS1_V5_R1       *GalPhotInternalTo_PS1_V5_R1 (GalPhot *in, off_t Nvalues);
 
 PhotCode                *PhotCode_PS1_V5_To_Internal (PhotCode_PS1_V5 *in, off_t Nvalues);
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert.c	(revision 38739)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert.c	(revision 38740)
@@ -884,4 +884,18 @@
   }
 
+  if (!strcmp (extname, "DVO_GALPHOT_PS1_V5") && (ftable[0].header[0].Naxis[0] == 72)) {
+    GalPhot_PS1_V5_R0 *tmpGalPhot;						
+    tmpGalPhot = gfits_table_get_GalPhot_PS1_V5_R0 (ftable, Ngalphot, NULL, &nativeBytes); 
+    if (!tmpGalPhot) {							
+      fprintf (stderr, "ERROR: failed to read galphots\n");		
+      exit (2);								
+    }									
+    galphot = GalPhot_PS1_V5_R0_ToInternal (tmpGalPhot, *Ngalphot); 
+    free (tmpGalPhot);							
+    ftable[0].buffer = NULL;
+    *format = DVO_FORMAT_PS1_V5;					
+    return (galphot); 
+  }
+
 # define SKIPPING_FORMAT(NAME, FORMAT, TYPE)				\
   if (!strcmp (extname, NAME)) {					\
@@ -926,5 +940,5 @@
   SKIPPING_FORMAT ("DVO_GALPHOT_PS1_V3",          PS1_V3,          PS1_V3);
   SKIPPING_FORMAT ("DVO_GALPHOT_PS1_V4",          PS1_V4,          PS1_V4);
-  CONVERT_FORMAT  ("DVO_GALPHOT_PS1_V5",          PS1_V5,          PS1_V5);
+  CONVERT_FORMAT  ("DVO_GALPHOT_PS1_V5",          PS1_V5,          PS1_V5_R1);
   SKIPPING_FORMAT ("DVO_GALPHOT_PS1_SIM",         PS1_SIM,         PS1_SIM);
 # undef CONVERT_FORMAT
@@ -965,5 +979,5 @@
 //    FORMAT_CASE (PS1_V3,          PS1_V3);
 //    FORMAT_CASE (PS1_V4,          PS1_V4);
-      FORMAT_CASE (PS1_V5,          PS1_V5);
+      FORMAT_CASE (PS1_V5,          PS1_V5_R1);
 # undef FORMAT_CASE
 
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 38739)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 38740)
@@ -983,5 +983,5 @@
 }
 
-GalPhot *GalPhot_PS1_V5_ToInternal (GalPhot_PS1_V5 *in, off_t Nvalues) {
+GalPhot *GalPhot_PS1_V5_R1_ToInternal (GalPhot_PS1_V5_R1 *in, off_t Nvalues) {
 
   off_t i;
@@ -1017,10 +1017,44 @@
 }
 
-GalPhot_PS1_V5 *GalPhotInternalTo_PS1_V5 (GalPhot *in, off_t Nvalues) {
-
-  off_t i;
-  GalPhot_PS1_V5 *out;
-
-  ALLOCATE_ZERO (out, GalPhot_PS1_V5, Nvalues);
+GalPhot *GalPhot_PS1_V5_R0_ToInternal (GalPhot_PS1_V5_R0 *in, off_t Nvalues) {
+
+  off_t i;
+  GalPhot *out;
+
+  ALLOCATE_ZERO (out, GalPhot, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+    dvo_galphot_init (&out[i]);
+
+    out[i].Xfit       	 = in[i].Xfit;
+    out[i].Yfit      	 = in[i].Yfit;
+    out[i].mag       	 = in[i].mag;
+    out[i].magErr    	 = in[i].magErr;
+    out[i].majorAxis 	 = in[i].majorAxis;
+    out[i].minorAxis 	 = in[i].minorAxis;
+    out[i].majorAxisErr  = in[i].majorAxisErr;
+    out[i].minorAxisErr  = in[i].minorAxisErr;
+    out[i].theta         = in[i].theta;
+    out[i].thetaErr      = in[i].thetaErr;
+    out[i].index         = in[i].index;
+    out[i].chisq	 = in[i].chisq;
+    out[i].Npix 	 = in[i].Npix;
+    out[i].objID	 = in[i].objID;
+    out[i].catID         = in[i].catID;
+    out[i].detID	 = in[i].detID;
+    out[i].imageID	 = in[i].imageID;
+//  out[i].averef	 = in[i].averef;
+    out[i].photcode	 = in[i].photcode;
+    out[i].modelType	 = in[i].modelType;
+  }
+  return (out);
+}
+
+GalPhot_PS1_V5_R1 *GalPhotInternalTo_PS1_V5_R1 (GalPhot *in, off_t Nvalues) {
+
+  off_t i;
+  GalPhot_PS1_V5_R1 *out;
+
+  ALLOCATE_ZERO (out, GalPhot_PS1_V5_R1, Nvalues);
 
   for (i = 0; i < Nvalues; i++) {
