TABLE detResidImfile, rawExp, rawImfile
TITLE detResidImfile Failures
FILE  detResidImfile_failure.php
MENU  ipp.detrend.dat

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

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

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

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

TAIL PHP insert_log ('LOG.IMFILE');
