TABLE detProcessedImfile, rawExp, rawImfile
TITLE detProcessedImfile Failures
FILE  detProcessedImfile_failure.php
MENU  ipp.detrend.dat

# the following WHERE clauses are added to all queries joined by AND
WHERE detProcessedImfile.exp_id = rawExp.exp_id
WHERE detProcessedImfile.exp_id = rawImfile.exp_id
WHERE detProcessedImfile.class_id = rawImfile.class_id
WHERE detProcessedImfile.fault > 0

ARGS  ARG1 detProcessedImfile.det_id=$detProcessedImfile.det_id
ARGS  ARG1 detProcessedImfile.exp_id=$detProcessedImfile.exp_id
ARGS  ARG1 detProcessedImfile.class_id=$detProcessedImfile.class_id
ARGS  ARG1 camera=$rawExp.camera
ARGS  ARG1 basename=$detProcessedImfile.path_base
ARGS  ARG1 class=$detProcessedImfile.class_id

#     field                          size  format  name      show   link to     extras
FIELD detProcessedImfile.det_id,       12, %d,     Det ID
FIELD detProcessedImfile.exp_id,        5, %d,     Exp ID
FIELD rawExp.exp_name,                  5, %s,     Exp Name
FIELD detProcessedImfile.class_id,      8, %s,     Chip ID,  value,  detProcessedImfile_failure.php, ARG1
FIELD detProcessedImfile.fault,         5, %d,     fault
FIELD detProcessedImfile.bg, 	        8, %.2f,   backgnd
FIELD detProcessedImfile.bg_stdev,      8, %.2f,   stdev
FIELD detProcessedImfile.bg_mean_stdev, 8, %.2f,   [stdev]
FIELD rawImfile.ccd_temp,               5, %.2f,   CCD Temp
FIELD detProcessedImfile.path_base,    20, %s,     path_base

FIELD rawExp.camera,                    5, %s,     Exp Name, none

# TD_CLASS det_off $detProcessedImfile.fault > 0

TAIL PHP insert_log ('LOG.IMFILE');
