STRUCT       Measure
EXTNAME      DVO_MEASURE
TYPE         BINTABLE
SIZE         146
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,           M_CAL,        float,          image cal mag,	            mag
FIELD Map,            M_APER,       float,          aperture mag,		    mag
FIELD dM,             MAG_ERR,      float,          mag error,                      mag
FIELD dMcal,          MAG_CAL_ERR,  float,          systematic calibration error,   mag
FIELD dt,             M_TIME,       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,              TIME,         int,   	    time in seconds (UNIX)
FIELD t_msec,         TIME_MSEC,    unsigned short, time fraction of second,        milliseconds
FIELD averef,         AVE_REF,      unsigned int,   reference to average entry      

FIELD detID,          DET_ID,       unsigned int,   detection ID
FIELD imageID,        IMAGE_ID,     unsigned int,   reference to DVO image 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

# PSPS uses a 64-bit detection ID
FIELD extID,          EXT_ID,       uint64_t,       external ID (eg PSPS detID)

# do we need more resolution than a short? should this be a log?
FIELD psfQual,        PSF_QF,       float,          psf coverage/quality factor
FIELD psfChisq,       PSF_CHISQ,    float,          psf fit chisq
FIELD psfNdof,        PSF_NDOF,     int,            psf degrees of freedom
FIELD psfNpix,        PSF_NPIX,     int,            psf number of pixels
FIELD crNsigma,       CR_NSIGMA,    float,          Nsigma deviation towards CR
FIELD extNsigma,      EXT_NSIGMA,   float,          Nsigma deviation towards EXT

# model shape parameters
FIELD FWx,            FWHM_MAJOR,   short,          object fwhm major axis,         1/100 of pixels 
FIELD FWy,            FWHM_MINOR,   short,          object fwhm minor axis,         1/100 of pixels 
FIELD theta,          PSF_THETA,    short,          angle wrt ccd X dir,            (0xffff/360) deg

# moments
FIELD Mxx,            MXX,          short,          second moments in pixel coords, 1/100 of pixels^2
FIELD Mxy,            MXY,          short,          second moments in pixel coords, 1/100 of pixels^2
FIELD Myy,            MYY,          short,          second moments in pixel coords, 1/100 of pixels^2

# convert this to error in pixels on load?
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 posangle,       POSANGLE,     short,          position angle sky to chip,     (0xffff/360) deg
FIELD pltscale,       PLTSCALE,     float,          plate scale,                    arcsec/pixel

FIELD photcode,       PHOTCODE,     unsigned short, photcode
FIELD dbFlags,        DB_FLAGS,     unsigned int,   flags supplied by analysis in database
FIELD photFlags,      PHOT_FLAGS,   unsigned int,   flags supplied by photometry program

# *** 20090206 : new fields : t_msec, extID, Mxx, Mxy, Myy, posangle,
#                psfNdof, psfNpix, Map_small; deprecated dophot.
#                Changed dbFlags, photFlags : uint16_t to uint64_t

# XXX unsigned int values are probably not being saved in the FITS file correctly: no BZERO, BSCALE
