Index: /branches/dvo-mods-2007-02/Ohana/src/libautocode/Makefile.Targets
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/libautocode/Makefile.Targets	(revision 12271)
+++ /branches/dvo-mods-2007-02/Ohana/src/libautocode/Makefile.Targets	(revision 12272)
@@ -5,4 +5,5 @@
 $(ASRC)/average-loneos.$(ARCH).o \
 $(ASRC)/average-elixir.$(ARCH).o \
+$(ASRC)/average-panstarrs-dev-0.$(ARCH).o \
 $(ASRC)/average-panstarrs.$(ARCH).o \
 $(ASRC)/average-pmtest.$(ARCH).o \
@@ -10,8 +11,10 @@
 $(ASRC)/secfilt-loneos.$(ARCH).o \
 $(ASRC)/secfilt-elixir.$(ARCH).o \
+$(ASRC)/secfilt-panstarrs-dev-0.$(ARCH).o \
 $(ASRC)/secfilt-panstarrs.$(ARCH).o \
 $(ASRC)/measure.$(ARCH).o \
 $(ASRC)/measure-loneos.$(ARCH).o \
 $(ASRC)/measure-elixir.$(ARCH).o \
+$(ASRC)/measure-panstarrs-dev-0.$(ARCH).o \
 $(ASRC)/measure-panstarrs.$(ARCH).o \
 $(ASRC)/missing.$(ARCH).o \
@@ -20,4 +23,5 @@
 $(ASRC)/image-loneos.$(ARCH).o \
 $(ASRC)/image-elixir.$(ARCH).o \
+$(ASRC)/image-panstarrs-dev-0.$(ARCH).o \
 $(ASRC)/image-panstarrs.$(ARCH).o \
 $(ASRC)/regimage.$(ARCH).o \
@@ -38,4 +42,5 @@
 $(AINC)/average-loneos.h \
 $(AINC)/average-elixir.h \
+$(AINC)/average-panstarrs-dev-0.h \
 $(AINC)/average-panstarrs.h \
 $(AINC)/average-pmtest.h \
@@ -43,8 +48,10 @@
 $(AINC)/secfilt-loneos.h \
 $(AINC)/secfilt-elixir.h \
+$(AINC)/secfilt-panstarrs-dev-0.h \
 $(AINC)/secfilt-panstarrs.h \
 $(AINC)/measure.h \
 $(AINC)/measure-loneos.h \
 $(AINC)/measure-elixir.h \
+$(AINC)/measure-panstarrs-dev-0.h \
 $(AINC)/measure-panstarrs.h \
 $(AINC)/missing.h \
@@ -53,4 +60,5 @@
 $(AINC)/image-loneos.h \
 $(AINC)/image-elixir.h \
+$(AINC)/image-panstarrs-dev-0.h \
 $(AINC)/image-panstarrs.h \
 $(AINC)/regimage.h \
Index: /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/average-panstarrs-dev-0.d
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/average-panstarrs-dev-0.d	(revision 12272)
+++ /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/average-panstarrs-dev-0.d	(revision 12272)
@@ -0,0 +1,49 @@
+STRUCT       AveragePanstarrs_DEV_0
+EXTNAME      DVO_AVERAGE_PANSTARRS_DEV_0
+TYPE         BINTABLE
+SIZE         72
+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
+
+# XXX drop the old primary magnitude concept
+# FIELD M,            MAG,        float,            primary mag,       	       	  mag
+# FIELD dM,           MAG_ERR,    float,            error on primary mag,         mag
+# 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 Xp,             SIGMA_POS,  short, 	    position scatter,   	  1/100 arcsec
+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
+
+# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
+FIELD objID_hi,       OBJ_ID_HI,    unsigned int,   ID upper bytes
+FIELD objID_lo,       OBJ_ID_LO,    unsigned int,   ID lower bytes
+
+# this structure should only be used for internal representations
+# the average-FORMAT structures should be used for external representations
+# note that the average magnitudes are stored in the 'secfilt' table (change this name??)
+# the index for the secfilt table is just Nsecfilt times the index for the average table.
+
+# XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
+# and move them to the secfilt table.
+
+# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
+# probably need to add position chisq
+
+# XXX include the number of measurements used to determine the positional information?
Index: /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/image-panstarrs-dev-0.d
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/image-panstarrs-dev-0.d	(revision 12272)
+++ /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/image-panstarrs-dev-0.d	(revision 12272)
@@ -0,0 +1,70 @@
+STRUCT       ImagePanstarrs_DEV_0
+EXTNAME      DVO_IMAGE_PANSTARRS_DEV_0
+TYPE         BINTABLE
+SIZE         256
+DESCRIPTION  DVO Image Table 
+
+# elements of the image structure
+
+SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
+SUBFIELD  crval1,           CRVAL1,               double,   	 coordinate at reference pixel
+SUBFIELD  crval2,           CRVAL2,               double,  	 coordinate at reference pixel
+SUBFIELD  crpix1,           CRPIX1,               float,   	 coordinate of reference pixel
+SUBFIELD  crpix2,           CRPIX2,               float,   	 coordinate of reference pixel
+SUBFIELD  cdelt1,           CDELT1,               float,   	 degrees per pixel
+SUBFIELD  cdelt2,           CDELT2,               float,    	 degrees per pixel
+SUBFIELD  pc1_1,            PC1_1,                float,    	 rotation matrix
+SUBFIELD  pc1_2,            PC1_2,                float,    	 rotation matrix
+SUBFIELD  pc2_1,            PC2_1,                float,    	 rotation matrix
+SUBFIELD  pc2_2,            PC2_2,                float,    	 rotation matrix
+SUBFIELD  polyterms,        POLYTERMS,            float[7][2],	 higher order warping terms
+SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
+SUBFIELD  Npolyterms,       NPOLYTERMS,           char,     	 order of polynomial
+# 120 bytes
+
+FIELD 	  tzero,            TZERO,                e_time,         readout time (row 0)
+FIELD 	  nstar,            NSTAR,                unsigned int,   number of stars on image
+FIELD 	  secz,             SECZ,                 float,      	  airmass,                   mag
+FIELD 	  NX,               NX,                   short,      	  image width
+FIELD 	  NY,               NY,                   short,      	  image height
+FIELD 	  apmifit,          APMIFIT,              float,      	  aperture correction,       mag
+FIELD 	  dapmifit,         DAPMIFIT,             float,      	  apmifit error,             mag
+FIELD 	  Mcal,             MCAL,                 float,      	  calibration mag,           mag
+FIELD 	  dMcal,            DMCAL,                float,      	  error on Mcal,             mag
+FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
+FIELD 	  photcode,         PHOTCODE,             short,      	  identifier for CCD,
+FIELD 	  exptime,          EXPTIME,              float,          exposure time,             seconds
+FIELD     sidtime,          ST,			  float,          sidereal time of exposure
+FIELD     latitude,         LAT,		  float,          observatory latitude,      degrees
+# 40 bytes
+
+FIELD 	  name,             NAME,                 char[32],       name of original image 
+FIELD 	  detection_limit,  DETECTION_LIMIT,      unsigned char,  detection limit,           10*mag
+FIELD 	  saturation_limit, SATURATION_LIMIT,     unsigned char,  saturation limit,          10*mag
+FIELD 	  cerror,           CERROR,               unsigned char,  astrometric error,         50*arcsec
+FIELD 	  fwhm_x,           FWHM_X,               unsigned char,  PSF x width,               25*arcsec
+FIELD 	  fwhm_y,           FWHM_Y,               unsigned char,  PSF y width,               25*arcsec
+FIELD 	  trate,            TRATE,                unsigned char,  scan rate,                 100 usec/pixel
+FIELD 	  code,             CODE,                 char,           image quality flag
+FIELD 	  ccdnum,           CCDNUM,               unsigned char,  CCD ID number
+FIELD 	  imageID_hi,       IMAGE_ID_HI,          unsigned int,   ID upper bytes
+FIELD 	  imageID_lo,       IMAGE_ID_LO,          unsigned int,   ID lower bytes
+# 48 bytes 
+
+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
Index: /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/measure-panstarrs-dev-0.d
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/measure-panstarrs-dev-0.d	(revision 12272)
+++ /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/measure-panstarrs-dev-0.d	(revision 12272)
@@ -0,0 +1,59 @@
+STRUCT       MeasurePanstarrs_DEV_0
+EXTNAME      DVO_MEASURE_PANSTARRS_DEV_0
+TYPE         BINTABLE
+SIZE         96
+DESCRIPTION  DVO Detection Measurement Table 
+
+FIELD dR,             D_RA,         float,          RA offset,                	  arcsec
+FIELD dD,             D_DEC,        float,          DEC offset,               	  arcsec
+FIELD M,              MAG,          float,          catalog mag,       	       	  mag
+FIELD Mcal,           Mcal,         float,          image cal mag,	          mag
+FIELD Mgal,           Mgal,         float,          galaxy mag,			  mag
+FIELD dM,             dM,           float,          mag error,                    mag
+FIELD dt,             dt,           float,          exposure time,                2.5*log(exptime)
+
+# note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation
+FIELD airmass,        airmass,      float,          (airmass - 1),		  airmass
+FIELD az,             AZ,           float,          telescope azimuth
+
+# new field elements needed for Pan-STARRS:
+FIELD Xccd,           X_CCD,        float,          X coord on chip,               pixels
+FIELD Yccd,           Y_CCD,        float,          Y coord on chip,               pixels
+
+# could these be packed into fewer bits?
+FIELD Sky,            SKY_FLUX,     float,          local estimate of sky flux,    counts/sec
+FIELD dSky,           SKY_FLUX_ERR, float,          local estimate of sky flux,    counts/sec
+
+FIELD t,              t,            unsigned int,   time in seconds (UNIX)
+FIELD averef,         averef,       unsigned int,   reference to average entry      
+
+# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
+FIELD detID_hi,       DET_ID_HI,    unsigned int,   ID upper bytes
+FIELD detID_lo,       DET_ID_LO,    unsigned int,   ID lower bytes
+
+FIELD imageID_hi,     IMAGE_ID_HI,  unsigned int,   reference to image
+FIELD imageID_lo,     IMAGE_ID_LO,  unsigned int,   reference to image
+
+FIELD FWx,            FWx,          short,          object fwhm major axis,       1/100 of arcsec 
+FIELD FWy,            FWy,          short,          object fwhm minor axis,       1/100 of arcsec 
+FIELD theta,          theta,        short,          angle wrt ccd X dir,          (0xffff/360) deg
+FIELD photcode,       photcode,     unsigned short, photcode
+
+FIELD flags,          flags,        unsigned short, flags for various uses  
+
+FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,         pixels
+FIELD dYccd,          Y_CCD_ERR,    short,          Y coord error on chip,         pixels
+
+# do we need more resolution than a short? should this be a log?
+FIELD qPSF,           PSF_QF,       short,          psf coverage/quality factor
+
+FIELD dophot,         dophot,       char,           dophot type
+FIELD stargal,        stargal,      char,           star-galaxy separator
+
+# we need extra bytes for padding purposes...
+FIELD dummy,          dummy,        char[2],        padding
+
+# float : 13 x 4 = 52
+# int:     6 x 4 = 24
+# short:   8 x 2 = 16
+# char :   2     =  2
Index: /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/secfilt-panstarrs-dev-0.d
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/secfilt-panstarrs-dev-0.d	(revision 12272)
+++ /branches/dvo-mods-2007-02/Ohana/src/libautocode/def/secfilt-panstarrs-dev-0.d	(revision 12272)
@@ -0,0 +1,13 @@
+STRUCT       SecFiltPanstarrs_DEV_0
+EXTNAME      DVO_SECFILT_PANSTARRS_DEV_0
+TYPE         BINTABLE
+SIZE         16
+DESCRIPTION  DVO SecFilt : Secondary Filter Data 
+
+# elements of data structure / FITS table
+FIELD  M,     MAG,      float,                other mags,       mags
+FIELD  dM,    MAG_ERR,  float,                scatter on mag,   mags
+FIELD  Xm,    MAG_CHI,  short,                chisq on mag,     [100*log(value)]
+FIELD  Ncode, NCODE,    short,                number of detections in band
+FIELD  Nused, NUSED,    short,                number of detections used in average
+FIELD  dummy, JUNK,     short,                place holder
