TABLE camRun, chipRun, rawExp, camProcessedExp
TITLE Per-Exposure Image Quality Stats
FILE  camIQstats.php
MENU  ipp.science.dat

# limit this table to non-OBJECT types of images
WHERE camRun.state = 'full'
WHERE camRun.chip_id = chipRun.chip_id
WHERE chipRun.exp_id = rawExp.exp_id
WHERE camProcessedExp.cam_id  = camRun.cam_id
WHERE camProcessedExp.fault = 0

ARGS  ARG1  rawImfile.exp_id=$rawExp.exp_id
ARGS  ARG2  chipRun.chip_id=$chipRun.chip_id

OP   OP1  0.5*($camProcessedExp.fwhm_major_uq + $camProcessedExp.fwhm_minor_uq)
OP   OP2  0.5*($camProcessedExp.fwhm_major_lq + $camProcessedExp.fwhm_minor_lq)

#     field                   size  format  name         show    link to                  extras
FIELD rawExp.exp_name,     	 5, %s,     Exp Name
FIELD chipRun.label,    	 7, %s,     Label
FIELD chipRun.data_group,    	 7, %s,     data grp
FIELD chipRun.dist_group,    	 7, %s,     dist grp
FIELD rawExp.dateobs,        	19, %T,     Date/Time
FIELD rawExp.filter,         	10, %s,     FILTER
FIELD rawExp.exp_time,       	 5, %.2f,     exp_time    
FIELD rawExp.airmass,        	 5, %.4f,     airmass     

FIELD camProcessedExp.fwhm_major, 5, %.2f, fwhm major psf
FIELD camProcessedExp.fwhm_minor, 5, %.2f, fwhm minor psf
FIELD camProcessedExp.fwhm_major_uq, 5, %.2f, fwhm UQ, op=OP1
FIELD camProcessedExp.fwhm_major_lq, 5, %.2f, fwhm LQ, op=OP2
FIELD camProcessedExp.fwhm_minor_uq, 5, %.2f, fwhm UQ, none
FIELD camProcessedExp.fwhm_minor_lq, 5, %.2f, fwhm UQ, none

FIELD camProcessedExp.iq_fwhm_major, 5, %.2f, fwhm major moments
FIELD camProcessedExp.iq_fwhm_minor, 5, %.2f, fwhm minor moments

FIELD camProcessedExp.iq_m2, 5, %.2f, m2 moment
FIELD camProcessedExp.iq_m3, 5, %.2f, m3 moment
FIELD camProcessedExp.iq_m4, 5, %.2f, m4 moment

