Index: trunk/ippMonitor/def/camIQstats.d
===================================================================
--- trunk/ippMonitor/def/camIQstats.d	(revision 20395)
+++ trunk/ippMonitor/def/camIQstats.d	(revision 20395)
@@ -0,0 +1,40 @@
+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 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
+
Index: trunk/ippMonitor/def/chipIQstats.d
===================================================================
--- trunk/ippMonitor/def/chipIQstats.d	(revision 20395)
+++ trunk/ippMonitor/def/chipIQstats.d	(revision 20395)
@@ -0,0 +1,45 @@
+TABLE chipRun, rawExp, chipProcessedImfile
+TITLE Per-Chip Image Quality Stats
+FILE  chipIQstats.php
+MENU  ipp.science.dat
+
+# limit this table to non-OBJECT types of images
+WHERE chipRun.state = 'full'
+WHERE chipRun.exp_id = rawExp.exp_id
+WHERE chipRun.chip_id = chipProcessedImfile.chip_id
+
+ARGS  ARG1  rawImfile.exp_id=$rawExp.exp_id
+ARGS  ARG2  chipRun.chip_id=$chipRun.chip_id
+
+OP   OP1  0.5*($chipProcessedImfile.fwhm_major_uq + $chipProcessedImfile.fwhm_minor_uq)
+OP   OP2  0.5*($chipProcessedImfile.fwhm_major_lq + $chipProcessedImfile.fwhm_minor_lq)
+
+#     field                   size  format  name         show    link to                  extras
+FIELD rawExp.exp_name,     	 5, %s,     Exp Name
+FIELD chipProcessedImfile.class_id, 5, %s,  chip
+FIELD chipRun.chip_id,    	 5, %d,     Ch ID,       value,  chipProcessedImfile.php, ARG2
+FIELD chipRun.label,    	 7, %s,     Label
+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 0.5*(chipProcessedImfile.fwhm_major + chipProcessedImfile.fwhm_minor) as fwhm, 5, %.2f, fwhm psf
+FIELD chipProcessedImfile.fwhm_major, 5, %.2f, fwhm major psf
+FIELD chipProcessedImfile.fwhm_minor, 5, %.2f, fwhm minor psf
+FIELD 0.5*(chipProcessedImfile.fwhm_major_uq + chipProcessedImfile.fwhm_minor_uq), 5, %.2f, fwhm UQ
+FIELD 0.5*(chipProcessedImfile.fwhm_major_lq + chipProcessedImfile.fwhm_minor_lq), 5, %.2f, fwhm LQ
+
+FIELD 0.5*(chipProcessedImfile.iq_fwhm_major + chipProcessedImfile.iq_fwhm_minor), 5, %.2f, fwhm moments
+FIELD chipProcessedImfile.iq_fwhm_major, 5, %.2f, fwhm major moments
+FIELD chipProcessedImfile.iq_fwhm_minor, 5, %.2f, fwhm minor moments
+
+#FIELD chipProcessedImfile.fwhm_major_uq, 5, %.2f, fwhm UQ, op=OP1
+#FIELD chipProcessedImfile.fwhm_major_lq, 5, %.2f, fwhm LQ, op=OP2
+#FIELD chipProcessedImfile.fwhm_minor_uq, 5, %.2f, fwhm UQ, none
+#FIELD chipProcessedImfile.fwhm_minor_lq, 5, %.2f, fwhm UQ, none
+
+FIELD chipProcessedImfile.iq_m2, 5, %.2f, m2 moment
+FIELD chipProcessedImfile.iq_m3, 5, %.2f, m3 moment
+FIELD chipProcessedImfile.iq_m4, 5, %.2f, m4 moment
+
