TABLE chipRun, rawExp, chipProcessedImfile
TITLE Chip Failed Imfiles
FILE  chipProcessedImfile_failure.php
MENU  ipp.science.dat

# limit this table to non-OBJECT types of images
WHERE chipRun.exp_id = rawExp.exp_id
WHERE chipProcessedImfile.exp_id = chipRun.exp_id
WHERE chipProcessedImfile.chip_id = chipRun.chip_id
WHERE chipProcessedImfile.fault != 0

ARGS  ARG1 exp_id=$chipRun.exp_id

ARGS  ARG2 chipRun.chip_id=$chipRun.chip_id
ARGS  ARG2 camera=$rawExp.camera
ARGS  ARG2 basename=$chipProcessedImfile.path_base
ARGS  ARG2 class=$chipProcessedImfile.class_id

OP   OP1  $rawExp.ra * 57.295783
OP   OP2  $rawExp.decl * 57.295783

#     field                            size  format  name         show    link to                  extras
FIELD chipRun.exp_id,         	   	  5, %s,     Exp ID,      value,  rawImfile.php,           ARG1
FIELD rawExp.exp_name,     	   	  5, %s,     Exp Name,    value,  chipProcessedImfile.php, ARG2
FIELD chipProcessedImfile.class_id,	  5, %s,     Class ID
FIELD chipRun.chip_id,        	   	  7, %s,     chip ID
FIELD rawExp.telescope,      	   	 10, %s,     Telescope
FIELD rawExp.camera,         	   	 10, %s,     Camera
FIELD rawExp.dateobs,        	   	 20, %s,     Date/Time
FIELD rawExp.filter,         	   	 10, %s,     FILTER
FIELD rawExp.ra,           	 	  8, %10.6f, RA,           op=OP1      
FIELD rawExp.decl,         	 	  8, %10.6f, DEC,          op=OP2
FIELD rawExp.object,       	   	  8, %s,     Object
FIELD rawExp.filter,       	   	  8, %s,     Filter
FIELD rawExp.exp_time,       	   	  5, %s,     exp_time    
FIELD rawExp.airmass,        	   	  5, %s,     airmass     
FIELD chipProcessedImfile.bg,             5, %s,     backgnd
FIELD chipProcessedImfile.bg_stdev,       5, %s,     stdev    
FIELD chipProcessedImfile.n_stars,  	  5, %s,     Nstars
FIELD chipProcessedImfile.n_astrom, 	  5, %s,     Nastrom
FIELD chipProcessedImfile.sigma_ra, 	  5, %s,     sigma ra
FIELD chipProcessedImfile.fwhm_major, 	  5, %s,     FHWM
FIELD chipProcessedImfile.path_base,      5, %s,     path_base, none
# FIELD chipPendingExp.reduction,        20, %s,     reduction
# FIELD chipPendingExp.guide_id,         20, %s,     guide ID
# FIELD chipProcessedImfile.bg_mean_stdev,  5, %s,     &lt;backgnd&gt;

TAIL PHP insert_log ('LOG.IMFILE');
