Index: /trunk/Ohana/src/addstar/include/addstar.h
===================================================================
--- /trunk/Ohana/src/addstar/include/addstar.h	(revision 12460)
+++ /trunk/Ohana/src/addstar/include/addstar.h	(revision 12461)
@@ -196,5 +196,5 @@
 Missing   *sort_missing     	  PROTO((Average *average, int Naverage, Missing *missing, int Nmissing, int *next_miss));
 Stars     *ConvertSMPDATA	  PROTO((FTable *table, int *nstars));
-// Stars *ConvertPS1DATA	  PROTO((FTable *table, int *nstars));
+Stars     *ConvertPS1_DEV_0	  PROTO((FTable *table, int *nstars));
 int        ImageOptions		  PROTO((AddstarClientOptions *options, Image *images, int Nimages));
 int        GetFileMode		  PROTO((Header *header));
Index: /trunk/Ohana/src/addstar/src/ReadStarsFITS.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 12460)
+++ /trunk/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 12461)
@@ -34,9 +34,7 @@
     stars = ConvertSMPDATA (&table, &Nstars);
   }
-# if (0)
-  if (!strcmp (type, "PS1DATA")) {
-    stars = ConvertPS1DATA (&table, &Nstars);
+  if (!strcmp (type, "PS1_DEV_0")) {
+    stars = ConvertPS1_DEV_0 (&table, &Nstars);
   }
-# endif
   if (stars == NULL) {
     fprintf (stderr, "ERROR: invalid table type %s\n", type);
@@ -60,4 +58,5 @@
   /* XXX we need to check at least the size of the loaded table */
 
+  // XXX use memset to zero-out the elements before setting
   ALLOCATE (stars, Stars, Nstars);
   for (i = 0; i < Nstars; i++) {
@@ -78,29 +77,61 @@
 }
 
-# if (0)
-Stars *ConvertPS1DATA (FTable *table, int *nstars) {
+Stars *ConvertPS1_DEV_0 (FTable *table, int *nstars) {
 
   int i, Nstars;
   Stars *stars;
-  PS1Data *ps1data;
+  PS1_DEV_0 *ps1data;
 
-  ps1data = gfits_table_get1Data (table, &Nstars, NULL);
+  ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL);
 
   ALLOCATE (stars, Stars, Nstars);
   for (i = 0; i < Nstars; i++) {
-    stars[i].X      = ps1data[i].X;
-    stars[i].Y      = ps1data[i].Y;
-    stars[i].M      = ps1data[i].M;
-    stars[i].dM     = ps1data[i].dM;
-    stars[i].dophot = ps1data[i].dophot;
+    stars[i].X       = ps1data[i].X;
+    stars[i].Y       = ps1data[i].Y;
+    stars[i].dX      = ps1data[i].dX;
+    stars[i].dY      = ps1data[i].dY;
+    stars[i].M       = ps1data[i].M;
+    stars[i].dM      = ps1data[i].dM;
+    stars[i].Mpeak   = ps1data[i].Mpeak;
 
-    stars[i].Mgal   = ps1data[i].M;
-    stars[i].Map    = ps1data[i].dM;
-    stars[i].fx     = ps1data[i].fx;
-    stars[i].fy     = ps1data[i].fy;
-    stars[i].df     = ps1data[i].df;
+    stars[i].sky     = ps1data[i].sky;
+    stars[i].dsky    = ps1data[i].dSky;
+
+    stars[i].fx      = ps1data[i].fx;
+    stars[i].fy      = ps1data[i].fy;
+    stars[i].df      = ps1data[i].df;
+
+    stars[i].psfProb = ps1data[i].psfProb;
+    stars[i].psfQual = ps1data[i].psfQual;
+
+    stars[i].detID   = ps1data[i].detID;
+
+    /* these are set elsewhere */
+    stars[i].R       = 0.0;
+    stars[i].D       = 0.0;
+    stars[i].dR      = 0.0;
+    stars[i].dD      = 0.0;
+
+    stars[i].uR      = 0.0;
+    stars[i].uD      = 0.0;
+    stars[i].duR     = 0.0;
+    stars[i].duD     = 0.0;
+
+    stars[i].P       = 0.0;
+    stars[i].dP      = 0.0;
+
+    stars[i].Mcal    = 0;
+    stars[i].t       = 0;
+    stars[i].dt      = 0;
+    stars[i].airmass = 0;
+    stars[i].code    = 0;
+    stars[i].found   = 0;
+
+    /* these are not used */
+    stars[i].Map     = NO_MAG;
+    stars[i].Mgal    = NO_MAG;
+    stars[i].dophot  = 0;
   }    
   *nstars = Nstars;
   return (stars);
 }
-# endif
Index: /trunk/Ohana/src/addstar/src/gstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/gstars.c	(revision 12460)
+++ /trunk/Ohana/src/addstar/src/gstars.c	(revision 12461)
@@ -156,6 +156,8 @@
       extsize[i] = headers[i][0].size + gfits_matrix_size (headers[i]);
       gfits_scan (headers[i], "EXTTYPE", "%s", 1, tmpword);
+
       if (!strcmp (tmpword, "SMPDATA") ||  
-	  !strcmp (tmpword, "PS1DATA")) {
+	  !strcmp (tmpword, "PS1_DEV_0")) {
+
 	  exttype[Nimage] = strcreate (tmpword);
 	  gfits_scan (headers[i], "EXTNAME", "%s", 1, tmpword);
Index: /trunk/Ohana/src/libautocode/Makefile.Targets
===================================================================
--- /trunk/Ohana/src/libautocode/Makefile.Targets	(revision 12460)
+++ /trunk/Ohana/src/libautocode/Makefile.Targets	(revision 12461)
@@ -29,4 +29,5 @@
 $(ASRC)/photreg.$(ARCH).o \
 $(ASRC)/photreg-old.$(ARCH).o \
+$(ASRC)/ps1_dev_0.$(ARCH).o \
 $(ASRC)/smpdata.$(ARCH).o \
 $(ASRC)/spectrum.$(ARCH).o \
@@ -66,4 +67,5 @@
 $(AINC)/photreg.h \
 $(AINC)/photreg-old.h \
+$(AINC)/ps1_dev_0.h \
 $(AINC)/smpdata.h \
 $(AINC)/spectrum.h \
Index: /trunk/Ohana/src/libautocode/def/Stars.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/Stars.d	(revision 12460)
+++ /trunk/Ohana/src/libautocode/def/Stars.d	(revision 12461)
@@ -2,8 +2,10 @@
 EXTNAME STARS
 TYPE    BINTABLE
-SIZE    188
+SIZE    232
 
 FIELD     X,                X,          double,    x coordinate on image,	     pixels
 FIELD     Y,                Y,          double,    y coordinate on image,	     pixels
+FIELD     dX,               dX,         double,    x coordinate error,	             pixels
+FIELD     dY,               dY,         double,    y coordinate error,  	     pixels
 FIELD     R,                R,          double,    ra coordinate on sky,	     decimal degrees
 FIELD     D,                D,          double,    dec coordinate on sky,	     decimal degrees
@@ -19,4 +21,5 @@
 FIELD     dM,               DM,         double,    error on mag
 FIELD     sky,              SKY,        double,    local sky counts
+FIELD     dsky,             dSKY,       double,    local sky error counts
 FIELD     fx,               FX,         double,    object FWHM x-dir,		     pixels?
 FIELD     fy,               FY,         double,    object FWHM y-dir,		     pixels?
@@ -24,12 +27,24 @@
 FIELD     Mgal,             MGAL,       double,    alternative (galaxy) magnitude
 FIELD     Map,              MAP,        double,    alternative (aperture) magnitude
+FIELD     Mpeak,            MPEAK,      double,    alternative (peak) magnitude
+FIELD     detID,            ID,         int,       detection identifier
 FIELD     found,            FOUND,      int,       found in database catalog?
 FIELD     t,                T,          e_time,    date/time of exposure (UNIX)
 FIELD     dt,               EXPTIME,    float,     exposure time,                    2.5*log(exptime)
-FIELD     code,             CODE,       short,     .
-FIELD     dophot,           DOPHOT,     char,      dophot type code
-FIELD     dummy,            DUMMY,      char[5],   .
+FIELD     psfProb,          PSF_PROB,   float
+FIELD     psfQual,          PSF_QUAL,   float
 FIELD     Mcal,             MCAL,       float,     image cal mag,	             mag
 FIELD     airmass,          AIRMASS,    float,     (airmass - 1),		     airmass
+FIELD     code,             CODE,       short
+FIELD     nFrames,          N_FRAMES,   short
+FIELD     dophot,           DOPHOT,     char,      dophot type code
+FIELD     dummy,            DUMMY,      char[3]
+
+# XXX I'm going to need azimuth (or load from image header?)
+
+# double:   24 * 8 : 192
+# int/float: 8 * 4 :  32
+# short:     2 * 2 :   4
+# char:      4 * 1 :   4
 
 # this structure is only used internally and for interprocess communication (addstar)
Index: /trunk/Ohana/src/libautocode/def/ps1_dev_0.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/ps1_dev_0.d	(revision 12461)
+++ /trunk/Ohana/src/libautocode/def/ps1_dev_0.d	(revision 12461)
@@ -0,0 +1,24 @@
+# name of structure type
+STRUCT  PS1_DEV_0
+EXTNAME PS1_DEV_0
+TYPE    BINTABLE
+SIZE    64
+
+# elements of data structure / FITS table
+FIELD detID,    IPP_IDET,      	  unsigned int, detection ID
+FIELD X,      	X_PSF,    	  float,    x coord,              pixels
+FIELD Y,      	Y_PSF,    	  float,    y coord,              pixels
+FIELD dX,      	X_PSF_SIG,    	  float,    x coord error,        pixels
+FIELD dY,      	Y_PSF_SIG,    	  float,    y coord error,        pixels
+FIELD M,      	PSF_INST_MAG,     float,    inst mags,            mags
+FIELD dM,     	PSF_INST_MAG_SIG, float,    inst mag error,       mags
+FIELD Mpeak,    PEAK_FLUX_AS_MAG, float,    inst mag error,       mags
+FIELD sky,    	SKY,              float,    sky flux,             cnts/sec
+FIELD dSky,    	SKY_SIG,          float,    sky flux errorf       cnts/sec
+FIELD psfProb,  PSF_PROBABILITY,  float,    psf probability
+FIELD fx,     	PSF_WIDTH_X,      float,    semi-major,           pixels
+FIELD fy,     	PSF_WIDTH_Y,      float,    semi-minor,           pixels
+FIELD df,     	PSF_THETA,        float,    ellipse angle,        degrees
+FIELD psfQual, 	PSF_QF,           float,    quality factor
+FIELD nFrames, 	N_FRAMES,         short,    images overlapping peak
+FIELD dummy,  	DUMMY,            short,    padding
