Index: /trunk/Ohana/src/libautocode/def/image-elixir.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-elixir.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-elixir.d	(revision 30604)
@@ -43,17 +43,17 @@
 FIELD 	  ccdnum,           CCDNUM,               unsigned char,  CCD ID number
 FIELD 	  dummy,            DUMMY,                char[20],       unused
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
+
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-loneos.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-loneos.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-loneos.d	(revision 30604)
@@ -43,17 +43,17 @@
 FIELD 	  ccdnum,           CCDNUM,               unsigned char,  CCD ID number
 FIELD 	  dummy,            DUMMY,                char[20],       unused
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
+
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-0.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-0.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-0.d	(revision 30604)
@@ -53,18 +53,16 @@
 
 FIELD 	  dummy,            DUMMY,                char[10],       unused
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-1.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-1.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-panstarrs-dev-1.d	(revision 30604)
@@ -53,18 +53,16 @@
 
 FIELD 	  dummy,            DUMMY,                char[10],       unused
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-ps1-dev-1.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-dev-1.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-dev-1.d	(revision 30604)
@@ -49,21 +49,20 @@
 FIELD 	  ccdnum,           CCDNUM,               unsigned char,  CCD ID number
 FIELD 	  imageID,          IMAGE_ID,             unsigned int,   image ID
+FIELD 	  dummy,            DUMMY,                char[14],       unused
 # 44 bytes 
 
-FIELD 	  dummy,            DUMMY,                char[14],       unused
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
 # 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-ps1-dev-2.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-dev-2.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-dev-2.d	(revision 30604)
@@ -53,18 +53,16 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-ps1-dev-3.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-dev-3.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-dev-3.d	(revision 30604)
@@ -54,18 +54,16 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-ps1-ref.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-ref.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-ref.d	(revision 30604)
@@ -55,18 +55,18 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
 # 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
+
Index: /trunk/Ohana/src/libautocode/def/image-ps1-v1.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-v1.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-v1.d	(revision 30604)
@@ -55,18 +55,16 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image-ps1-v2.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image-ps1-v2.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image-ps1-v2.d	(revision 30604)
@@ -60,18 +60,16 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
-# 40 bytes
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
Index: /trunk/Ohana/src/libautocode/def/image.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/image.d	(revision 30604)
@@ -1,3 +1,3 @@
-STRUCT       Image
+ STRUCT       Image
 EXTNAME      DVO_IMAGE
 TYPE         BINTABLE
@@ -6,4 +6,5 @@
 
 # elements of the image structure
+# careful of 8-byte boundaries
 
 SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
@@ -60,21 +61,38 @@
 # 48 bytes 
 
-FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
-FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
-FIELD 	  My,               MY,                   short,      	  Mrel polyterm
-FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
-FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
-FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
-FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
-FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
-FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
-FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
-FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
-FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
-FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
-FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
-FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
+FIELD 	  nLinkAstrom,      NLINK_ASTROM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  nLinkPhotom,      NLINK_PHOTOM,         short,      	  mean number of matched measurements for astrometry
+FIELD 	  dummy3,           DUMMY3,               short,      	  place holder for byte boundaries
+
+FIELD 	  dXpixSys,         XPIX_SYS_ERR,         float,      	  systematic astrometry error in X
+FIELD 	  dYpixSys,         YPIX_SYS_ERR,         float,      	  systematic astrometry error in Y
+
+FIELD 	  dMagSys,          MAG_SYS_ERR,          float,      	  systematic photometry error
+FIELD 	  nFitAstrom,       N_FIT_ASTROM,         short,      	  number of stars used for astrometry cal
+FIELD 	  nFitPhotom,       N_FIT_PHOTOM,         short,      	  number of stars used for photometry cal
+
+FIELD 	  photom_map_id,    PHOTOM_MAP_ID,        unsigned int,   reference to 2D zero point map
+FIELD 	  astrom_map_id,    ASTROM_MAP_ID,        unsigned int,   reference to 2D astrometry map
+# nFitPhotom lands on the old location of Mxxxx, which was used to mean nFitPhotom in some cases
+
+# old image structure:
+# FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
+# FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
+# FIELD 	  My,               MY,                   short,      	  Mrel polyterm
+# FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
+# FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
+# FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
+# FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
+# FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
+# FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
+# FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
+# FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
+# FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
+# FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
+# FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
+# FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
 # 40 bytes
 
 # *** 20090206 : new fields : parentID, flags (was code char), changed name to 121 bytes.
-# *** 20100331 : new fields : 
+# *** 20100331 : new fields : RAo, DECo. Radius
+# *** 20110203 : replace the old zero point polynomial terms (Mx,My,... Mxxxx,Myyyy) with dummy1 - astrom_map_id
Index: /trunk/Ohana/src/libautocode/def/measure-ps1-v2.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/measure-ps1-v2.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/measure-ps1-v2.d	(revision 30604)
@@ -63,6 +63,7 @@
 FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,          1/100 of pixels
 FIELD dYccd,          Y_CCD_ERR,    short,          Y coord error on chip,          1/100 of pixels
+FIELD dRsys,          POS_SYS_ERR,  short,          systematic error from astrom,   1/100 of pixels
 
-FIELD pad,            PAD,          char[6],        padding
+FIELD pad,            PAD,          char[4],        padding
 
 # local astrometry scales
Index: /trunk/Ohana/src/libautocode/def/measure.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/measure.d	(revision 30603)
+++ /trunk/Ohana/src/libautocode/def/measure.d	(revision 30604)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_MEASURE
 TYPE         BINTABLE
-SIZE         146
+SIZE         148
 DESCRIPTION  DVO Detection Measurement Table 
 
@@ -59,4 +59,5 @@
 FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,          1/100 of pixels
 FIELD dYccd,          Y_CCD_ERR,    short,          Y coord error on chip,          1/100 of pixels
+FIELD dRsys,          POS_SYS_ERR,  short,          systematic error from astrom,   1/100 of pixels
 
 FIELD posangle,       POSANGLE,     short,          position angle sky to chip,     (0xffff/360) deg
