Index: trunk/Ohana/src/libautocode/Makefile
===================================================================
--- trunk/Ohana/src/libautocode/Makefile	(revision 6678)
+++ trunk/Ohana/src/libautocode/Makefile	(revision 6683)
@@ -29,4 +29,5 @@
 $(SRC)/average-elixir.$(ARCH).o \
 $(SRC)/average-panstarrs.$(ARCH).o \
+$(SRC)/average-pmtest.$(ARCH).o \
 $(SRC)/secfilt.$(ARCH).o \
 $(SRC)/secfilt-loneos.$(ARCH).o \
@@ -61,4 +62,5 @@
 $(INC)/average-elixir.h \
 $(INC)/average-panstarrs.h \
+$(INC)/average-pmtest.h \
 $(INC)/secfilt.h \
 $(INC)/secfilt-loneos.h \
Index: trunk/Ohana/src/libautocode/def/Stars.d
===================================================================
--- trunk/Ohana/src/libautocode/def/Stars.d	(revision 6678)
+++ trunk/Ohana/src/libautocode/def/Stars.d	(revision 6683)
@@ -2,23 +2,34 @@
 EXTNAME STARS
 TYPE    BINTABLE
-SIZE    128
+SIZE    176
 
-FIELD     X,                X,            	  double,         x coordinate on image
-FIELD     Y,                Y,            	  double,         y coordinate on image
-FIELD     R,                R,            	  double,         ra coordinate on sky
-FIELD     D,                D,            	  double,         dec coordinate on sky
-FIELD     uR,               uR,            	  double,         proper motion in RA
-FIELD     uD,               uD,            	  double,         proper motion in DEC 
-FIELD     M,                M,            	  double,         instrumental mag
-FIELD     dM,               DM,           	  double,         error on mag
-FIELD     sky,              SKY,          	  double,         local sky counts
-FIELD     fx,               FX,           	  double,         object FWHM x-dir
-FIELD     fy,               FY,           	  double,         object FWHM y-dir
-FIELD     df,               DF,           	  double,         object position angle
-FIELD     Mgal,             MGAL,         	  double,         alternative (galaxy) magnitude
-FIELD     Map,              MAP,          	  double,         alternative (aperture) magnitude
-FIELD     found,            FOUND,        	  int,            found in database catalog?
-FIELD     t,                T,            	  e_time,         date/time of exposure (UNIX)
-FIELD     code,             CODE,         	  short,          .
-FIELD     dophot,           DOPHOT,       	  char,           dophot type code
-FIELD     dummy,            DUMMY,         	  char[5],        .
+FIELD     X,                X,          double,    x coordinate on image,	     pixels
+FIELD     Y,                Y,          double,    y coordinate on image,	     pixels
+FIELD     R,                R,          double,    ra coordinate on sky,	     decimal degrees
+FIELD     D,                D,          double,    dec coordinate on sky,	     decimal degrees
+FIELD     dR,               dR,         double,    ra error,			     arcsec
+FIELD     dD,               dD,         double,    dec error,			     arcsec
+FIELD     uR,               U_RA,       double,    proper motion in RA,		     milliarcsec/year
+FIELD     uD,               U_DEC,      double,    proper motion in DEC,	     milliarcsec/year
+FIELD     duR,              U_RA_ERR,   double,    p-m error in RA,		     milliarcsec/year
+FIELD     duD,              U_DEC_ERR,  double,    p-m error in DEC,		     milliarcsec/year
+FIELD     P,                PAR,        double,    parallax,			     milliarcsec
+FIELD     dP,               PAR_ERR,    double,    parallax error,		     milliarcsec
+FIELD     M,                M,          double,    instrumental mag
+FIELD     dM,               DM,         double,    error on mag
+FIELD     sky,              SKY,        double,    local sky counts
+FIELD     fx,               FX,         double,    object FWHM x-dir,		     pixels?
+FIELD     fy,               FY,         double,    object FWHM y-dir,		     pixels?
+FIELD     df,               DF,         double,    object position angle,	     degrees
+FIELD     Mgal,             MGAL,       double,    alternative (galaxy) magnitude
+FIELD     Map,              MAP,        double,    alternative (aperture) magnitude
+FIELD     found,            FOUND,      int,       found in database catalog?
+FIELD     t,                T,          e_time,    date/time of exposure (UNIX)
+FIELD     code,             CODE,       short,     .
+FIELD     dophot,           DOPHOT,     char,      dophot type code
+FIELD     dummy,            DUMMY,      char[5],   .
+
+# this structure is only used internally and for interprocess communication (addstar)
+# dR, uR, etc should be better defined at the pole...
+# define down the types to floats where reasonable (all but R,D)?
+# R,D should be in ICRS, J2000, epoch 2000 : precess as needed, apply p-m as needed
Index: trunk/Ohana/src/libautocode/def/average-panstarrs.d
===================================================================
--- trunk/Ohana/src/libautocode/def/average-panstarrs.d	(revision 6678)
+++ trunk/Ohana/src/libautocode/def/average-panstarrs.d	(revision 6683)
@@ -18,3 +18,5 @@
 FIELD offset,         offset,     int,     	    offset to first measurement
 FIELD missing,        missing,    int,     	    offset to first missing obs
-FIELD dummy,          dummmy,     int,              extra space
+FIELD dummy,          dummy,      int,              extra space
+
+# change this table eventually to a temp name and provide a script to fix existing DBs
Index: trunk/Ohana/src/libautocode/def/average-pmtest.d
===================================================================
--- trunk/Ohana/src/libautocode/def/average-pmtest.d	(revision 6683)
+++ trunk/Ohana/src/libautocode/def/average-pmtest.d	(revision 6683)
@@ -0,0 +1,31 @@
+STRUCT       AveragePMtest
+EXTNAME      DVO_AVERAGE_PMTEST
+TYPE         BINTABLE
+SIZE         76
+DESCRIPTION  DVO Average Object Table
+
+# elements of data structure / FITS table
+
+FIELD R,              RA,         double,           RA,                	       	  decimal degrees 
+FIELD D,              DEC,        double,           DEC,               	       	  decimal degrees 
+FIELD dR,             RA_ERR,     float,            RA error                      arcsec
+FIELD dD,             DEC_ERR,    float,            DEC error                     arcsec
+
+FIELD uR,             U_RA,       float,            RA*cos(D) proper-motion,      arcsec/year
+FIELD uD,             U_DEC,      float,            DEC proper-motion,            arcsec/year
+FIELD duR,            V_RA_ERR,   float,            RA*cos(D) p-m error,          arcsec/year
+FIELD duD,            V_DEC_ERR,  float,            DEC p-m error,                arcsec/year
+FIELD P,              PAR,        float,            parallax,			  arcsec
+FIELD dP,             PAR_ERR,    float,            parallax error,               arcsec
+
+FIELD M,              MAG,        float,            primary mag,       	       	  mag
+FIELD dM,             MAG_ERR,    float,            error on primary mag,         mag
+FIELD Xp,             SIGMA_POS,  short, 	    position scatter,   	  1/100 arcsec
+FIELD Xm,             CHISQ_MAG,  short, 	    chisq for primary mag,        [100*log(value)]
+FIELD Xg,             CHISQ_GAL,  short,            chisq for galaxy mags,        [100*log(value)]
+FIELD Nm,             NMEAS,      unsigned short,   number of measures
+FIELD Nn,             NMISS,      unsigned short,   number of missings
+FIELD code,           code,       unsigned short,   ID code (star ghost etc)
+FIELD offset,         offset,     int,     	    offset to first measurement
+FIELD missing,        missing,    int,     	    offset to first missing obs
+
Index: trunk/Ohana/src/libautocode/def/average.d
===================================================================
--- trunk/Ohana/src/libautocode/def/average.d	(revision 6678)
+++ trunk/Ohana/src/libautocode/def/average.d	(revision 6683)
@@ -2,13 +2,23 @@
 EXTNAME      DVO_AVERAGE
 TYPE         BINTABLE
-SIZE         44
+SIZE         76
 DESCRIPTION  DVO Average Object Table
 
 # elements of data structure / FITS table
 
-FIELD R_PS,           RA,         double,           RA,                	       	  decimal degrees 
-FIELD D_PS,           DEC,        double,           DEC,               	       	  decimal degrees 
-FIELD M_PS,           MAG,        float,            primary mag,       	       	  mag
-FIELD dM_PS,          MAG_ERR,    float,            error on primary mag,         mag
+FIELD R,              RA,         double,           RA,                	       	  decimal degrees 
+FIELD D,              DEC,        double,           DEC,               	       	  decimal degrees 
+FIELD dR,             RA_ERR,     float,            RA error                      arcsec
+FIELD dD,             DEC_ERR,    float,            DEC error                     arcsec
+
+FIELD uR,             U_RA,       float,            RA*cos(D) proper-motion,      arcsec/year
+FIELD uD,             U_DEC,      float,            DEC proper-motion,            arcsec/year
+FIELD duR,            V_RA_ERR,   float,            RA*cos(D) p-m error,          arcsec/year
+FIELD duD,            V_DEC_ERR,  float,            DEC p-m error,                arcsec/year
+FIELD P,              PAR,        float,            parallax,			  arcsec
+FIELD dP,             PAR_ERR,    float,            parallax error,               arcsec
+
+FIELD M,              MAG,        float,            primary mag,       	       	  mag
+FIELD dM,             MAG_ERR,    float,            error on primary mag,         mag
 FIELD Xp,             SIGMA_POS,  short, 	    position scatter,   	  1/100 arcsec
 FIELD Xm,             CHISQ_MAG,  short, 	    chisq for primary mag,        [100*log(value)]
@@ -20,9 +30,4 @@
 FIELD missing,        missing,    int,     	    offset to first missing obs
 
-# 
-# V_RA,   float,            proper-motion (arcsec/year),
-# V_DEC   float,            proper-motion (arcsec/year),
-# PAR     float             parallax (arcseconds)
-# D_V_RA  float,            proper-motion error (arcsec/year),
-# D_V_DEC float,            proper-motion error (arcsec/year),
-# D_PAR   float             parallax error (arcseconds)
+# this structure should only be used for internal representations
+# the average-FORMAT structures should be used for external representations
