# name of structure type
STRUCT  CMF_PS1_V1
EXTNAME CMF_PS1_V1
TYPE    BINTABLE
SIZE    128

# 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 RA,      	 RA_PSF,    	   float,    PSF RA coord,          degrees
FIELD DEC,     	 DEC_PSF,    	   float,    PSF DEC coord,         degrees
FIELD posangle,  POSANGLE,    	   float,    Posangle at source,    degrees
FIELD pltscale,  PLTSCALE,    	   float,    Plate Scale at source, arcsec/pixel
FIELD M,      	 PSF_INST_MAG,     float,    inst mags,             mags
FIELD dM,     	 PSF_INST_MAG_SIG, float,    inst mag error,        mags
FIELD Map,       AP_MAG_STANDARD,  float,    standard aperture mag, mags
FIELD apRadius,  AP_MAG_RADIUS,    float,    radius used for fit,   pixels
FIELD Mpeak,     PEAK_FLUX_AS_MAG, float,    peak flux as a mag,    mags
FIELD Mcalib,    CAL_PSF_MAG,      float,    calibrated psf mag,    mags
FIELD dMcal,     CAL_PSF_MAG_SIG,  float,    zero point scatter,    mags
FIELD sky,    	 SKY,              float,    sky flux,              cnts/sec
FIELD dSky,    	 SKY_SIG,          float,    sky flux error,        cnts/sec
FIELD psfChisq,  PSF_CHISQ,        float,    psf fit chisq
FIELD crNsigma,  CR_NSIGMA,        float,    Nsigma deviations from PSF to CF
FIELD extNsigma, EXT_NSIGMA,       float,    Nsigma deviations from PSF to EXT
FIELD fx,     	 PSF_MAJOR,        float,    psf fit major axis,    pixels
FIELD fy,     	 PSF_MINOR,        float,    psf fit minor axis,    pixels
FIELD df,     	 PSF_THETA,        float,    ellipse angle,         degrees
FIELD psfQual, 	 PSF_QF,           float,    quality factor
FIELD psfNdof, 	 PSF_NDOF,         int,      psf degrees of freedom
FIELD psfNpix, 	 PSF_NPIX,         int,      psf number of pixels
FIELD Mxx,     	 MOMENTS_XX,       float,    second moment X,       pixels^2
FIELD Mxy,     	 MOMENTS_XY,       float,    second moment Y,       pixels^2
FIELD Myy,     	 MOMENTS_YY,       float,    second moment XY,      pixels^2
FIELD flags,  	 FLAGS,            int,      analysis flags
FIELD nFrames, 	 N_FRAMES,         short,    images overlapping peak
FIELD padding,   PADDING,	   short,    padding for 8byte records

# for an object in an image, we have three triplets that tell us about the shape:
# second moments: Mxx, Mxy, Myy 
# model shape parameters: F_major, F_minor, F_theta
# centroid errors: sigma_X, sigma_Y, sigma_XY

# IPP_IDET         1J  IPP_IDET,     	   unsigned i
# X_PSF       	 1E  X_PSF,    	   float,        
# Y_PSF       	 1E  Y_PSF,    	   float,        
# X_PSF_SIG   	 1E  X_PSF_SIG,    	   float,        
# Y_PSF_SIG   	 1E  Y_PSF_SIG,    	   float,        
# RA_PSF      	 1E  RA_PSF,    	   float,        
# DEC_PSF     	 1E  DEC_PSF,    	   float,        
# POSANGLE    	 1E  POSANGLE,    	   float,        
# PLTSCALE    	 1E  PLTSCALE,    	   float,        
# PSF_INST_MAG	 1E  PSF_INST_MAG,     float,          
# PSF_INST_MAG_SIG 1E  PSF_INST_MAG_SIG, float,        
# AP_MAG_STANDARD  1E  AP_MAG_STANDARD,  float,        
# AP_MAG_RADIUS    1E      
# PEAK_FLUX_AS_MAG 1E  PEAK_FLUX_AS_MAG, float,        
# CAL_PSF_MAG      1E  CAL_PSF_MAG,      float,        
# CAL_PSF_MAG_SIG  1E  CAL_PSF_MAG_SIG,  float,        
# SKY              1E  SKY,              float,        
# SKY_SIGMA        1E  SKY_SIG,          float,        
# PSF_CHISQ        1E  PSF_CHISQ,        float,        
# CR_NSIGMA        1E  CR_NSIGMA,        float,        
# EXT_NSIGMA       1E  EXT_NSIGMA,       float,        
# PSF_MAJOR        1E  PSF_MAJOR,        float,        
# PSF_MINOR        1E  PSF_MINOR,        float,        
# PSF_THETA        1E  PSF_THETA,        float,        
# PSF_QF           1E  PSF_QF,           float,        
# PSF_NDOF         1J  PSF_NDOF,         int,          
# PSF_NPIX         1J  PSF_NPIX,         int,          
# MOMENTS_XX       1E  MOMENTS_XX,       float,        
# MOMENTS_XY       1E  MOMENTS_XY,       float,        
# MOMENTS_YY       1E  MOMENTS_YY,       float,        
# N_FRAMES         1I  N_FRAMES,         short,        
# FLAGS            1J  FLAGS,            int,          
