Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/Makefile.Targets
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/Makefile.Targets	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/Makefile.Targets	(revision 38100)
@@ -48,6 +48,8 @@
 $(ASRC)/lensing-ps1-v5-r1.$(ARCH).o \
 $(ASRC)/lensing-ps1-v5-r2.$(ARCH).o \
+$(ASRC)/lensing-ps1-v5-r3.$(ARCH).o \
 $(ASRC)/lensobj.$(ARCH).o \
-$(ASRC)/lensobj-ps1-v5.$(ARCH).o \
+$(ASRC)/lensobj-ps1-v5-r0.$(ARCH).o \
+$(ASRC)/lensobj-ps1-v5-r1.$(ARCH).o \
 $(ASRC)/starpar.$(ARCH).o \
 $(ASRC)/starpar-ps1-v5.$(ARCH).o \
@@ -156,6 +158,8 @@
 $(AINC)/lensing-ps1-v5-r1.h \
 $(AINC)/lensing-ps1-v5-r2.h \
+$(AINC)/lensing-ps1-v5-r3.h \
 $(AINC)/lensobj.h \
-$(AINC)/lensobj-ps1-v5.h \
+$(AINC)/lensobj-ps1-v5-r0.h \
+$(AINC)/lensobj-ps1-v5-r1.h \
 $(AINC)/starpar.h \
 $(AINC)/starpar-ps1-v5.h \
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing-ps1-v5-r3.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing-ps1-v5-r3.d	(revision 38100)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing-ps1-v5-r3.d	(revision 38100)
@@ -0,0 +1,60 @@
+STRUCT       Lensing_PS1_V5_R3
+EXTNAME      DVO_LENSING_PS1_V5
+TYPE         BINTABLE
+SIZE         160
+DESCRIPTION  DVO Lensing Table 
+
+FIELD X11_sm_obj,     X11_SM_OBJ,    float,          lensing smear object X11
+FIELD X12_sm_obj,     X12_SM_OBJ,    float,          lensing smear object X12
+FIELD X22_sm_obj,     X22_SM_OBJ,    float,          lensing smear object X22
+FIELD  E1_sm_obj,      E1_SM_OBJ,    float,          lensing smear object E1
+FIELD  E2_sm_obj,      E2_SM_OBJ,    float,          lensing smear object E2
+
+FIELD X11_sh_obj,     X11_SH_OBJ,    float,          lensing shear object X11
+FIELD X12_sh_obj,     X12_SH_OBJ,    float,          lensing shear object X12
+FIELD X22_sh_obj,     X22_SH_OBJ,    float,          lensing shear object X22
+FIELD  E1_sh_obj,      E1_SH_OBJ,    float,          lensing shear object E1
+FIELD  E2_sh_obj,      E2_SH_OBJ,    float,          lensing shear object E2
+
+FIELD X11_sm_psf,     X11_SM_PSF,    float,          lensing smear psf stars X11
+FIELD X12_sm_psf,     X12_SM_PSF,    float,          lensing smear psf stars X12
+FIELD X22_sm_psf,     X22_SM_PSF,    float,          lensing smear psf stars X22
+FIELD  E1_sm_psf,      E1_SM_PSF,    float,          lensing smear psf stars E1
+FIELD  E2_sm_psf,      E2_SM_PSF,    float,          lensing smear psf stars E2
+
+FIELD X11_sh_psf,     X11_SH_PSF,    float,          lensing shear psf stars X11
+FIELD X12_sh_psf,     X12_SH_PSF,    float,          lensing shear psf stars X12
+FIELD X22_sh_psf,     X22_SH_PSF,    float,          lensing shear psf stars X22
+FIELD  E1_sh_psf,      E1_SH_PSF,    float,          lensing shear psf stars E1
+FIELD  E2_sh_psf,      E2_SH_PSF,    float,          lensing shear psf stars E2
+
+FIELD  E1_psf,         E1_PSF,       float,          polarization psf stars E1
+FIELD  E2_psf,         E2_PSF,       float,          polarization psf stars E2
+
+FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
+FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
+FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
+FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
+
+FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
+FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
+FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
+FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
+
+FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
+FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
+FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
+FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
+
+FIELD  detID,          DET_ID,       unsigned int,   detection ID
+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  averef,         AVE_REF,      unsigned int,   reference to average entry      
+
+FIELD imageID,	       IMAGE_ID,     unsigned int,   reference to DVO image ID
+FIELD padding,	       PADDING,      unsigned int,   reference to DVO image ID
+
+# 28 x float
+# 4 x int
+# = 128 bytes / detection
+# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing.d	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensing.d	(revision 38100)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_LENSING
 TYPE         BINTABLE
-SIZE         144
+SIZE         160
 DESCRIPTION  DVO Lensing Table 
 
@@ -32,13 +32,18 @@
 FIELD  E2_psf,         E2_PSF,       float,          polarization psf stars E2
 
-FIELD F_ApR5,        FLUX_AP_R5,     float,          Flux inside r = 5
+FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
 FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
 FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
 FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
 
-FIELD F_ApR6,        FLUX_AP_R6,     float,          Flux inside r = 5
-FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 5
-FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 5
-FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 5
+FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
+FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
+FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
+FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
+
+FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
+FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
+FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
+FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
 
 FIELD   detID,          DET_ID,      int,   	     detection ID
@@ -50,6 +55,4 @@
 FIELD padding,	       PADDING,      int,   	     padding
 
-# 28 x float
-# 5 x int + padding
-# = 136 bytes / detection
+# 160 bytes / detection
 # for 2.5G objects + 60 overlaps, expect 15TB for forced warp
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r0.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r0.d	(revision 38100)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r0.d	(revision 38100)
@@ -0,0 +1,53 @@
+STRUCT       Lensobj_PS1_V5_R0
+EXTNAME      DVO_LENSOBJ_PS1_V5
+TYPE         BINTABLE
+SIZE         136
+DESCRIPTION  DVO Lensobj Table 
+
+FIELD X11_sm_obj,     X11_SM_OBJ,    float,          mean lensing smear object X11
+FIELD X12_sm_obj,     X12_SM_OBJ,    float,          mean lensing smear object X12
+FIELD X22_sm_obj,     X22_SM_OBJ,    float,          mean lensing smear object X22
+FIELD  E1_sm_obj,      E1_SM_OBJ,    float,          mean lensing smear object E1
+FIELD  E2_sm_obj,      E2_SM_OBJ,    float,          mean lensing smear object E2
+
+FIELD X11_sh_obj,     X11_SH_OBJ,    float,          mean lensing shear object X11
+FIELD X12_sh_obj,     X12_SH_OBJ,    float,          mean lensing shear object X12
+FIELD X22_sh_obj,     X22_SH_OBJ,    float,          mean lensing shear object X22
+FIELD  E1_sh_obj,      E1_SH_OBJ,    float,          mean lensing shear object E1
+FIELD  E2_sh_obj,      E2_SH_OBJ,    float,          mean lensing shear object E2
+
+FIELD X11_sm_psf,     X11_SM_PSF,    float,          mean lensing smear psf stars X11
+FIELD X12_sm_psf,     X12_SM_PSF,    float,          mean lensing smear psf stars X12
+FIELD X22_sm_psf,     X22_SM_PSF,    float,          mean lensing smear psf stars X22
+FIELD  E1_sm_psf,      E1_SM_PSF,    float,          mean lensing smear psf stars E1
+FIELD  E2_sm_psf,      E2_SM_PSF,    float,          mean lensing smear psf stars E2
+
+FIELD X11_sh_psf,     X11_SH_PSF,    float,          mean lensing shear psf stars X11
+FIELD X12_sh_psf,     X12_SH_PSF,    float,          mean lensing shear psf stars X12
+FIELD X22_sh_psf,     X22_SH_PSF,    float,          mean lensing shear psf stars X22
+FIELD  E1_sh_psf,      E1_SH_PSF,    float,          mean lensing shear psf stars E1
+FIELD  E2_sh_psf,      E2_SH_PSF,    float,          mean lensing shear psf stars E2
+
+FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
+FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
+FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
+FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
+
+FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
+FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
+FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
+FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
+
+FIELD  gamma,            GAMMA,      float
+FIELD     E1,               E1,      float
+FIELD     E2,               E2,      float
+
+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 photcode,         PHOTCODE,    short
+FIELD    Nmeas,            NMEAS,    short
+
+# 31 x float
+#  3 x int
+# = 136 bytes / detection
+# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r1.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r1.d	(revision 38100)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5-r1.d	(revision 38100)
@@ -0,0 +1,58 @@
+STRUCT       Lensobj_PS1_V5_R1
+EXTNAME      DVO_LENSOBJ_PS1_V5
+TYPE         BINTABLE
+SIZE         152
+DESCRIPTION  DVO Lensobj Table 
+
+FIELD X11_sm_obj,     X11_SM_OBJ,    float,          mean lensing smear object X11
+FIELD X12_sm_obj,     X12_SM_OBJ,    float,          mean lensing smear object X12
+FIELD X22_sm_obj,     X22_SM_OBJ,    float,          mean lensing smear object X22
+FIELD  E1_sm_obj,      E1_SM_OBJ,    float,          mean lensing smear object E1
+FIELD  E2_sm_obj,      E2_SM_OBJ,    float,          mean lensing smear object E2
+
+FIELD X11_sh_obj,     X11_SH_OBJ,    float,          mean lensing shear object X11
+FIELD X12_sh_obj,     X12_SH_OBJ,    float,          mean lensing shear object X12
+FIELD X22_sh_obj,     X22_SH_OBJ,    float,          mean lensing shear object X22
+FIELD  E1_sh_obj,      E1_SH_OBJ,    float,          mean lensing shear object E1
+FIELD  E2_sh_obj,      E2_SH_OBJ,    float,          mean lensing shear object E2
+
+FIELD X11_sm_psf,     X11_SM_PSF,    float,          mean lensing smear psf stars X11
+FIELD X12_sm_psf,     X12_SM_PSF,    float,          mean lensing smear psf stars X12
+FIELD X22_sm_psf,     X22_SM_PSF,    float,          mean lensing smear psf stars X22
+FIELD  E1_sm_psf,      E1_SM_PSF,    float,          mean lensing smear psf stars E1
+FIELD  E2_sm_psf,      E2_SM_PSF,    float,          mean lensing smear psf stars E2
+
+FIELD X11_sh_psf,     X11_SH_PSF,    float,          mean lensing shear psf stars X11
+FIELD X12_sh_psf,     X12_SH_PSF,    float,          mean lensing shear psf stars X12
+FIELD X22_sh_psf,     X22_SH_PSF,    float,          mean lensing shear psf stars X22
+FIELD  E1_sh_psf,      E1_SH_PSF,    float,          mean lensing shear psf stars E1
+FIELD  E2_sh_psf,      E2_SH_PSF,    float,          mean lensing shear psf stars E2
+
+FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
+FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
+FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
+FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
+
+FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
+FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
+FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
+FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
+
+FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
+FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
+FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
+FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
+
+FIELD  gamma,            GAMMA,      float
+FIELD     E1,               E1,      float
+FIELD     E2,               E2,      float
+
+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 photcode,         PHOTCODE,    short
+FIELD    Nmeas,            NMEAS,    short
+
+# 31 x float
+#  3 x int
+# = 136 bytes / detection
+# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj-ps1-v5.d	(revision 38099)
+++ 	(revision )
@@ -1,53 +1,0 @@
-STRUCT       Lensobj_PS1_V5
-EXTNAME      DVO_LENSOBJ_PS1_V5
-TYPE         BINTABLE
-SIZE         136
-DESCRIPTION  DVO Lensobj Table 
-
-FIELD X11_sm_obj,     X11_SM_OBJ,    float,          mean lensing smear object X11
-FIELD X12_sm_obj,     X12_SM_OBJ,    float,          mean lensing smear object X12
-FIELD X22_sm_obj,     X22_SM_OBJ,    float,          mean lensing smear object X22
-FIELD  E1_sm_obj,      E1_SM_OBJ,    float,          mean lensing smear object E1
-FIELD  E2_sm_obj,      E2_SM_OBJ,    float,          mean lensing smear object E2
-
-FIELD X11_sh_obj,     X11_SH_OBJ,    float,          mean lensing shear object X11
-FIELD X12_sh_obj,     X12_SH_OBJ,    float,          mean lensing shear object X12
-FIELD X22_sh_obj,     X22_SH_OBJ,    float,          mean lensing shear object X22
-FIELD  E1_sh_obj,      E1_SH_OBJ,    float,          mean lensing shear object E1
-FIELD  E2_sh_obj,      E2_SH_OBJ,    float,          mean lensing shear object E2
-
-FIELD X11_sm_psf,     X11_SM_PSF,    float,          mean lensing smear psf stars X11
-FIELD X12_sm_psf,     X12_SM_PSF,    float,          mean lensing smear psf stars X12
-FIELD X22_sm_psf,     X22_SM_PSF,    float,          mean lensing smear psf stars X22
-FIELD  E1_sm_psf,      E1_SM_PSF,    float,          mean lensing smear psf stars E1
-FIELD  E2_sm_psf,      E2_SM_PSF,    float,          mean lensing smear psf stars E2
-
-FIELD X11_sh_psf,     X11_SH_PSF,    float,          mean lensing shear psf stars X11
-FIELD X12_sh_psf,     X12_SH_PSF,    float,          mean lensing shear psf stars X12
-FIELD X22_sh_psf,     X22_SH_PSF,    float,          mean lensing shear psf stars X22
-FIELD  E1_sh_psf,      E1_SH_PSF,    float,          mean lensing shear psf stars E1
-FIELD  E2_sh_psf,      E2_SH_PSF,    float,          mean lensing shear psf stars E2
-
-FIELD F_ApR5,        FLUX_AP_R5,     float,          Flux inside r = 5
-FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
-FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
-FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
-
-FIELD F_ApR6,        FLUX_AP_R6,     float,          Flux inside r = 5
-FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 5
-FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 5
-FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 5
-
-FIELD  gamma,            GAMMA,      float
-FIELD     E1,               E1,      float
-FIELD     E2,               E2,      float
-
-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 photcode,         PHOTCODE,    short
-FIELD    Nmeas,            NMEAS,    short
-
-# 31 x float
-#  3 x int
-# = 136 bytes / detection
-# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
Index: branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj.d
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj.d	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libautocode/def/lensobj.d	(revision 38100)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_LENSOBJ
 TYPE         BINTABLE
-SIZE         136
+SIZE         152
 DESCRIPTION  DVO Lensobj Table 
 
@@ -29,13 +29,18 @@
 FIELD  E2_sh_psf,      E2_SH_PSF,    float,          mean lensing shear psf stars E2
 
-FIELD F_ApR5,        FLUX_AP_R5,     float,          Flux inside r = 5
+FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
 FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
 FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
 FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
 
-FIELD F_ApR6,        FLUX_AP_R6,     float,          Flux inside r = 5
-FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 5
-FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 5
-FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 5
+FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
+FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
+FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
+FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
+
+FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
+FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
+FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
+FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
 
 FIELD      gamma,        GAMMA,      float
Index: branches/eam_branches/ipp-20150405/Ohana/src/libdvo/include/ps1_v5_defs.h
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libdvo/include/ps1_v5_defs.h	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libdvo/include/ps1_v5_defs.h	(revision 38100)
@@ -8,14 +8,15 @@
 SecFilt_PS1_V5          *SecFiltInternalTo_PS1_V5 (SecFilt *in, off_t Nvalues);
 
-typedef Lensing_PS1_V5_R2 Lensing_PS1_V5;
+Lensobj 	       	*Lensobj_PS1_V5_R0_ToInternal (Lensobj_PS1_V5_R0 *in, off_t Nvalues);
+Lensobj 	       	*Lensobj_PS1_V5_R1_ToInternal (Lensobj_PS1_V5_R1 *in, off_t Nvalues);
 
-Lensing 	       	*Lensing_PS1_V5_ToInternal (Lensing_PS1_V5 *in, off_t Nvalues);
-Lensing_PS1_V5_R2       *LensingInternalTo_PS1_V5_R2 (Lensing *in, off_t Nvalues);
-Lensobj 	       	*Lensobj_PS1_V5_ToInternal (Lensobj_PS1_V5 *in, off_t Nvalues);
-Lensobj_PS1_V5          *LensobjInternalTo_PS1_V5 (Lensobj *in, off_t Nvalues);
+Lensobj_PS1_V5_R1       *LensobjInternalTo_PS1_V5_R1 (Lensobj *in, off_t Nvalues);
 
 Lensing 	       	*Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues);
 Lensing 	       	*Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues);
 Lensing 	       	*Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues);
+Lensing 	       	*Lensing_PS1_V5_R3_ToInternal (Lensing_PS1_V5_R3 *in, off_t Nvalues);
+
+Lensing_PS1_V5_R3       *LensingInternalTo_PS1_V5_R3 (Lensing *in, off_t Nvalues);
 
 StarPar 	       	*StarPar_PS1_V5_ToInternal (StarPar_PS1_V5 *in, off_t Nvalues);
Index: branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert.c	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert.c	(revision 38100)
@@ -455,4 +455,23 @@
     return (lensing); }
 
+  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 144)) {
+    Lensing_PS1_V5_R2 *tmpLensing;						
+    tmpLensing = gfits_table_get_Lensing_PS1_V5_R2 (ftable, Nlensing, NULL); 
+    if (!tmpLensing) {							
+      fprintf (stderr, "ERROR: failed to read lensings\n");		
+      exit (2);								
+    }									
+    lensing = Lensing_PS1_V5_R2_ToInternal (tmpLensing, *Nlensing); 
+    free (tmpLensing);							
+    *format = DVO_FORMAT_PS1_V5;					
+    return (lensing); }
+
+# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)		\
+  if (!strcmp (extname, NAME)) {					\
+    fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
+    *Nlensing = 0; \
+    return NULL; \
+  }
+
 # define CONVERT_FORMAT(NAME, FORMAT, TYPE)		\
   if (!strcmp (extname, NAME)) {					\
@@ -468,11 +487,4 @@
     return (lensing); }
 
-# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)		\
-  if (!strcmp (extname, NAME)) {					\
-    fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
-    *Nlensing = 0; \
-    return NULL; \
-  }
-
   if (!strcmp (extname, "DVO_LENSING")) {
     lensing = gfits_table_get_Lensing (ftable, Nlensing, NULL);
@@ -496,5 +508,5 @@
   SKIPPING_FORMAT ("DVO_LENSING_PS1_V3",          PS1_V3,          PS1_V3);
   SKIPPING_FORMAT ("DVO_LENSING_PS1_V4",          PS1_V4,          PS1_V4);
-  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R2);
+  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R3);
   SKIPPING_FORMAT ("DVO_LENSING_PS1_SIM",         PS1_SIM,         PS1_SIM);
 # undef CONVERT_FORMAT
@@ -535,5 +547,5 @@
 //    FORMAT_CASE (PS1_V3,          PS1_V3);
 //    FORMAT_CASE (PS1_V4,          PS1_V4);
-      FORMAT_CASE (PS1_V5,          PS1_V5_R2);
+      FORMAT_CASE (PS1_V5,          PS1_V5_R3);
 # undef FORMAT_CASE
 
@@ -557,4 +569,16 @@
     return (FALSE);
   }
+
+  if (!strcmp (extname, "DVO_LENSOBJ_PS1_V5") && (ftable[0].header[0].Naxis[0] == 136)) {
+    Lensobj_PS1_V5_R0 *tmpLensobj;						
+    tmpLensobj = gfits_table_get_Lensobj_PS1_V5_R0 (ftable, Nlensobj, NULL); 
+    if (!tmpLensobj) {							
+      fprintf (stderr, "ERROR: failed to read lensobjs\n");		
+      exit (2);								
+    }									
+    lensobj = Lensobj_PS1_V5_R0_ToInternal (tmpLensobj, *Nlensobj); 
+    free (tmpLensobj);							
+    *format = DVO_FORMAT_PS1_V5;					
+    return (lensobj); }
 
 # define SKIPPING_FORMAT(NAME, FORMAT, TYPE)		\
@@ -599,5 +623,5 @@
   SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V3",          PS1_V3,          PS1_V3);
   SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V4",          PS1_V4,          PS1_V4);
-  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5);
+  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5_R1);
   SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_SIM",         PS1_SIM,         PS1_SIM);
 # undef CONVERT_FORMAT
@@ -638,5 +662,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-20150405/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 38099)
+++ branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 38100)
@@ -448,5 +448,5 @@
 }
 
-Lensing *Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues) {
+Lensing *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues) {
 
   off_t i;
@@ -481,7 +481,4 @@
     out[i].E1_sh_psf   = in[i].E1_sh_psf;
     out[i].E2_sh_psf   = in[i].E2_sh_psf;
-
-    out[i].E1_psf      = in[i].E1_psf;
-    out[i].E2_psf      = in[i].E2_psf;
 
     out[i].F_ApR5      = in[i].F_ApR5;
@@ -499,18 +496,17 @@
     out[i].catID       = in[i].catID;
     out[i].averef      = in[i].averef;
-
-    out[i].imageID     = in[i].imageID;
-  }
-  return (out);
-}
-
-Lensing_PS1_V5_R2 *LensingInternalTo_PS1_V5_R2 (Lensing *in, off_t Nvalues) {
-
-  off_t i;
-  Lensing_PS1_V5_R2 *out;
-
-  ALLOCATE_ZERO (out, Lensing_PS1_V5, Nvalues);
-
-  for (i = 0; i < Nvalues; i++) {
+  }
+  return (out);
+}
+
+Lensing *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues) {
+
+  off_t i;
+  Lensing *out;
+
+  ALLOCATE_ZERO (out, Lensing, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+    dvo_lensing_init (&out[i]);
 
     out[i].X11_sm_obj  = in[i].X11_sm_obj;      
@@ -537,7 +533,4 @@
     out[i].E1_sh_psf   = in[i].E1_sh_psf;
     out[i].E2_sh_psf   = in[i].E2_sh_psf;
-
-    out[i].E1_psf      = in[i].E1_psf;
-    out[i].E2_psf      = in[i].E2_psf;
 
     out[i].F_ApR5      = in[i].F_ApR5;
@@ -561,5 +554,185 @@
 }
 
-Lensobj *Lensobj_PS1_V5_ToInternal (Lensobj_PS1_V5 *in, off_t Nvalues) {
+Lensing *Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues) {
+
+  off_t i;
+  Lensing *out;
+
+  ALLOCATE_ZERO (out, Lensing, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+    dvo_lensing_init (&out[i]);
+
+    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
+    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
+    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
+    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
+    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
+	             	                 
+    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
+    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
+    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
+    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
+    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
+	             	                 
+    out[i].X11_sm_psf  = in[i].X11_sm_psf;
+    out[i].X12_sm_psf  = in[i].X12_sm_psf;
+    out[i].X22_sm_psf  = in[i].X22_sm_psf;
+    out[i].E1_sm_psf   = in[i].E1_sm_psf;
+    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
+	             	                 
+    out[i].X11_sh_psf  = in[i].X11_sh_psf;
+    out[i].X12_sh_psf  = in[i].X12_sh_psf;
+    out[i].X22_sh_psf  = in[i].X22_sh_psf;
+    out[i].E1_sh_psf   = in[i].E1_sh_psf;
+    out[i].E2_sh_psf   = in[i].E2_sh_psf;
+
+    out[i].E1_psf      = in[i].E1_psf;
+    out[i].E2_psf      = in[i].E2_psf;
+
+    out[i].F_ApR5      = in[i].F_ApR5;
+    out[i].dF_ApR5     = in[i].dF_ApR5;
+    out[i].sF_ApR5     = in[i].sF_ApR5;
+    out[i].fF_ApR5     = in[i].fF_ApR5;
+	               	            
+    out[i].F_ApR6      = in[i].F_ApR6;
+    out[i].dF_ApR6     = in[i].dF_ApR6;
+    out[i].sF_ApR6     = in[i].sF_ApR6;
+    out[i].fF_ApR6     = in[i].fF_ApR6;
+	          	            
+    out[i].detID       = in[i].detID;
+    out[i].objID       = in[i].objID;
+    out[i].catID       = in[i].catID;
+    out[i].averef      = in[i].averef;
+
+    out[i].imageID     = in[i].imageID;
+  }
+  return (out);
+}
+
+Lensing *Lensing_PS1_V5_R3_ToInternal (Lensing_PS1_V5_R3 *in, off_t Nvalues) {
+
+  off_t i;
+  Lensing *out;
+
+  ALLOCATE_ZERO (out, Lensing, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+    dvo_lensing_init (&out[i]);
+
+    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
+    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
+    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
+    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
+    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
+	             	                 
+    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
+    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
+    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
+    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
+    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
+	             	                 
+    out[i].X11_sm_psf  = in[i].X11_sm_psf;
+    out[i].X12_sm_psf  = in[i].X12_sm_psf;
+    out[i].X22_sm_psf  = in[i].X22_sm_psf;
+    out[i].E1_sm_psf   = in[i].E1_sm_psf;
+    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
+	             	                 
+    out[i].X11_sh_psf  = in[i].X11_sh_psf;
+    out[i].X12_sh_psf  = in[i].X12_sh_psf;
+    out[i].X22_sh_psf  = in[i].X22_sh_psf;
+    out[i].E1_sh_psf   = in[i].E1_sh_psf;
+    out[i].E2_sh_psf   = in[i].E2_sh_psf;
+
+    out[i].E1_psf      = in[i].E1_psf;
+    out[i].E2_psf      = in[i].E2_psf;
+
+    out[i].F_ApR5      = in[i].F_ApR5;
+    out[i].dF_ApR5     = in[i].dF_ApR5;
+    out[i].sF_ApR5     = in[i].sF_ApR5;
+    out[i].fF_ApR5     = in[i].fF_ApR5;
+	               	            
+    out[i].F_ApR6      = in[i].F_ApR6;
+    out[i].dF_ApR6     = in[i].dF_ApR6;
+    out[i].sF_ApR6     = in[i].sF_ApR6;
+    out[i].fF_ApR6     = in[i].fF_ApR6;
+	          	            
+    out[i].F_ApR7      = in[i].F_ApR7;
+    out[i].dF_ApR7     = in[i].dF_ApR7;
+    out[i].sF_ApR7     = in[i].sF_ApR7;
+    out[i].fF_ApR7     = in[i].fF_ApR7;
+	          	            
+    out[i].detID       = in[i].detID;
+    out[i].objID       = in[i].objID;
+    out[i].catID       = in[i].catID;
+    out[i].averef      = in[i].averef;
+
+    out[i].imageID     = in[i].imageID;
+  }
+  return (out);
+}
+
+Lensing_PS1_V5_R3 *LensingInternalTo_PS1_V5_R3 (Lensing *in, off_t Nvalues) {
+
+  off_t i;
+  Lensing_PS1_V5_R3 *out;
+
+  ALLOCATE_ZERO (out, Lensing_PS1_V5_R3, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+
+    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
+    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
+    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
+    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
+    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
+	             	                 
+    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
+    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
+    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
+    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
+    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
+	             	                 
+    out[i].X11_sm_psf  = in[i].X11_sm_psf;
+    out[i].X12_sm_psf  = in[i].X12_sm_psf;
+    out[i].X22_sm_psf  = in[i].X22_sm_psf;
+    out[i].E1_sm_psf   = in[i].E1_sm_psf;
+    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
+	             	                 
+    out[i].X11_sh_psf  = in[i].X11_sh_psf;
+    out[i].X12_sh_psf  = in[i].X12_sh_psf;
+    out[i].X22_sh_psf  = in[i].X22_sh_psf;
+    out[i].E1_sh_psf   = in[i].E1_sh_psf;
+    out[i].E2_sh_psf   = in[i].E2_sh_psf;
+
+    out[i].E1_psf      = in[i].E1_psf;
+    out[i].E2_psf      = in[i].E2_psf;
+
+    out[i].F_ApR5      = in[i].F_ApR5;
+    out[i].dF_ApR5     = in[i].dF_ApR5;
+    out[i].sF_ApR5     = in[i].sF_ApR5;
+    out[i].fF_ApR5     = in[i].fF_ApR5;
+	               	            
+    out[i].F_ApR6      = in[i].F_ApR6;
+    out[i].dF_ApR6     = in[i].dF_ApR6;
+    out[i].sF_ApR6     = in[i].sF_ApR6;
+    out[i].fF_ApR6     = in[i].fF_ApR6;
+	          	            
+    out[i].F_ApR7      = in[i].F_ApR7;
+    out[i].dF_ApR7     = in[i].dF_ApR7;
+    out[i].sF_ApR7     = in[i].sF_ApR7;
+    out[i].fF_ApR7     = in[i].fF_ApR7;
+	          	            
+    out[i].detID       = in[i].detID;
+    out[i].objID       = in[i].objID;
+    out[i].catID       = in[i].catID;
+    out[i].averef      = in[i].averef;
+
+    out[i].imageID     = in[i].imageID;
+  }
+  return (out);
+}
+
+Lensobj *Lensobj_PS1_V5_R0_ToInternal (Lensobj_PS1_V5_R0 *in, off_t Nvalues) {
 
   off_t i;
@@ -618,12 +791,13 @@
 }
 
-Lensobj_PS1_V5 *LensobjInternalTo_PS1_V5 (Lensobj *in, off_t Nvalues) {
-
-  off_t i;
-  Lensobj_PS1_V5 *out;
-
-  ALLOCATE_ZERO (out, Lensobj_PS1_V5, Nvalues);
-
-  for (i = 0; i < Nvalues; i++) {
+Lensobj *Lensobj_PS1_V5_R1_ToInternal (Lensobj_PS1_V5_R1 *in, off_t Nvalues) {
+
+  off_t i;
+  Lensobj *out;
+
+  ALLOCATE_ZERO (out, Lensobj, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+    dvo_lensobj_init (&out[i], FALSE);
 
     out[i].X11_sm_obj  = in[i].X11_sm_obj;      
@@ -660,4 +834,70 @@
     out[i].sF_ApR6     = in[i].sF_ApR6;
     out[i].fF_ApR6     = in[i].fF_ApR6;
+	          	            
+    out[i].F_ApR7      = in[i].F_ApR7;
+    out[i].dF_ApR7     = in[i].dF_ApR7;
+    out[i].sF_ApR7     = in[i].sF_ApR7;
+    out[i].fF_ApR7     = in[i].fF_ApR7;
+	          	            
+    out[i].gamma       = in[i].gamma;
+    out[i].E1          = in[i].E1;
+    out[i].E2          = in[i].E2;
+
+    out[i].objID       = in[i].objID;
+    out[i].catID       = in[i].catID;
+
+    out[i].photcode    = in[i].photcode;
+    out[i].Nmeas       = in[i].Nmeas;
+  }
+  return (out);
+}
+
+Lensobj_PS1_V5_R1 *LensobjInternalTo_PS1_V5_R1 (Lensobj *in, off_t Nvalues) {
+
+  off_t i;
+  Lensobj_PS1_V5_R1 *out;
+
+  ALLOCATE_ZERO (out, Lensobj_PS1_V5_R1, Nvalues);
+
+  for (i = 0; i < Nvalues; i++) {
+
+    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
+    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
+    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
+    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
+    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
+	             	                 
+    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
+    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
+    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
+    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
+    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
+	             	                 
+    out[i].X11_sm_psf  = in[i].X11_sm_psf;
+    out[i].X12_sm_psf  = in[i].X12_sm_psf;
+    out[i].X22_sm_psf  = in[i].X22_sm_psf;
+    out[i].E1_sm_psf   = in[i].E1_sm_psf;
+    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
+	             	                 
+    out[i].X11_sh_psf  = in[i].X11_sh_psf;
+    out[i].X12_sh_psf  = in[i].X12_sh_psf;
+    out[i].X22_sh_psf  = in[i].X22_sh_psf;
+    out[i].E1_sh_psf   = in[i].E1_sh_psf;
+    out[i].E2_sh_psf   = in[i].E2_sh_psf;
+
+    out[i].F_ApR5      = in[i].F_ApR5;
+    out[i].dF_ApR5     = in[i].dF_ApR5;
+    out[i].sF_ApR5     = in[i].sF_ApR5;
+    out[i].fF_ApR5     = in[i].fF_ApR5;
+	               	            
+    out[i].F_ApR6      = in[i].F_ApR6;
+    out[i].dF_ApR6     = in[i].dF_ApR6;
+    out[i].sF_ApR6     = in[i].sF_ApR6;
+    out[i].fF_ApR6     = in[i].fF_ApR6;
+	          	            
+    out[i].F_ApR7      = in[i].F_ApR7;
+    out[i].dF_ApR7     = in[i].dF_ApR7;
+    out[i].sF_ApR7     = in[i].sF_ApR7;
+    out[i].fF_ApR7     = in[i].fF_ApR7;
 	          	            
     out[i].gamma       = in[i].gamma;
@@ -1271,110 +1511,4 @@
   }
   return (data);
-}
-
-Lensing *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues) {
-
-  off_t i;
-  Lensing *out;
-
-  ALLOCATE_ZERO (out, Lensing, Nvalues);
-
-  for (i = 0; i < Nvalues; i++) {
-    dvo_lensing_init (&out[i]);
-
-    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
-    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
-    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
-    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
-    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
-	             	                 
-    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
-    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
-    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
-    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
-    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
-	             	                 
-    out[i].X11_sm_psf  = in[i].X11_sm_psf;
-    out[i].X12_sm_psf  = in[i].X12_sm_psf;
-    out[i].X22_sm_psf  = in[i].X22_sm_psf;
-    out[i].E1_sm_psf   = in[i].E1_sm_psf;
-    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
-	             	                 
-    out[i].X11_sh_psf  = in[i].X11_sh_psf;
-    out[i].X12_sh_psf  = in[i].X12_sh_psf;
-    out[i].X22_sh_psf  = in[i].X22_sh_psf;
-    out[i].E1_sh_psf   = in[i].E1_sh_psf;
-    out[i].E2_sh_psf   = in[i].E2_sh_psf;
-
-    out[i].F_ApR5      = in[i].F_ApR5;
-    out[i].dF_ApR5     = in[i].dF_ApR5;
-    out[i].sF_ApR5     = in[i].sF_ApR5;
-    out[i].fF_ApR5     = in[i].fF_ApR5;
-	               	            
-    out[i].F_ApR6      = in[i].F_ApR6;
-    out[i].dF_ApR6     = in[i].dF_ApR6;
-    out[i].sF_ApR6     = in[i].sF_ApR6;
-    out[i].fF_ApR6     = in[i].fF_ApR6;
-	          	            
-    out[i].detID       = in[i].detID;
-    out[i].objID       = in[i].objID;
-    out[i].catID       = in[i].catID;
-    out[i].averef      = in[i].averef;
-  }
-  return (out);
-}
-
-Lensing *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues) {
-
-  off_t i;
-  Lensing *out;
-
-  ALLOCATE_ZERO (out, Lensing, Nvalues);
-
-  for (i = 0; i < Nvalues; i++) {
-    dvo_lensing_init (&out[i]);
-
-    out[i].X11_sm_obj  = in[i].X11_sm_obj;      
-    out[i].X12_sm_obj  = in[i].X12_sm_obj;      
-    out[i].X22_sm_obj  = in[i].X22_sm_obj;      
-    out[i].E1_sm_obj   = in[i].E1_sm_obj;      
-    out[i].E2_sm_obj   = in[i].E2_sm_obj;      
-	             	                 
-    out[i].X11_sh_obj  = in[i].X11_sh_obj;      
-    out[i].X12_sh_obj  = in[i].X12_sh_obj;      
-    out[i].X22_sh_obj  = in[i].X22_sh_obj;      
-    out[i].E1_sh_obj   = in[i].E1_sh_obj;      
-    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
-	             	                 
-    out[i].X11_sm_psf  = in[i].X11_sm_psf;
-    out[i].X12_sm_psf  = in[i].X12_sm_psf;
-    out[i].X22_sm_psf  = in[i].X22_sm_psf;
-    out[i].E1_sm_psf   = in[i].E1_sm_psf;
-    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
-	             	                 
-    out[i].X11_sh_psf  = in[i].X11_sh_psf;
-    out[i].X12_sh_psf  = in[i].X12_sh_psf;
-    out[i].X22_sh_psf  = in[i].X22_sh_psf;
-    out[i].E1_sh_psf   = in[i].E1_sh_psf;
-    out[i].E2_sh_psf   = in[i].E2_sh_psf;
-
-    out[i].F_ApR5      = in[i].F_ApR5;
-    out[i].dF_ApR5     = in[i].dF_ApR5;
-    out[i].sF_ApR5     = in[i].sF_ApR5;
-    out[i].fF_ApR5     = in[i].fF_ApR5;
-	               	            
-    out[i].F_ApR6      = in[i].F_ApR6;
-    out[i].dF_ApR6     = in[i].dF_ApR6;
-    out[i].sF_ApR6     = in[i].sF_ApR6;
-    out[i].fF_ApR6     = in[i].fF_ApR6;
-	          	            
-    out[i].detID       = in[i].detID;
-    out[i].objID       = in[i].objID;
-    out[i].catID       = in[i].catID;
-    out[i].averef      = in[i].averef;
-
-    out[i].imageID     = in[i].imageID;
-  }
-  return (out);
 }
 
