TABLE detResidExp, rawExp
TITLE detResidExp
FILE  detResidExp.php
MENU  ipp.detrend.dat

# the following WHERE clauses are added to all queries joined by AND
WHERE detResidExp.exp_id = rawExp.exp_id

# define image names to be used below
# IMAGE VAR basename filerule camera class_id
IMAGE JPEG2 $detResidExp.path_base PPIMAGE.JPEG2 $rawExp.camera NONE

# define the arguments supplied to the links below (if any)
ARGS  ARG1 exp_id=$detResidExp.exp_id

ARGS  ARG2 detResidImfile.det_id=$detResidExp.det_id
ARGS  ARG2 detResidImfile.iteration=$detResidExp.iteration
ARGS  ARG2 detResidImfile.exp_id=$detResidExp.exp_id
ARGS  ARG2 camera=$rawExp.camera
ARGS  ARG2 basename=$detResidExp.path_base

OP    OP1  $detResidExp.bg / $detResidExp.bin_stdev

#     field                   size  format  name       show         link to              linkargs
FIELD detResidExp.det_id,        7, %s,     Det ID,    value
FIELD rawExp.camera,            10, %s,     camera,    value
FIELD detResidExp.exp_id, 	 5, %s,     Exp ID,    value,       rawImfile.php,       ARG1
FIELD rawExp.exp_name, 	         5, %s,     Exp Name,  value,       rawImfile.php,       ARG1
FIELD detResidExp.iteration,     5, %s,     iter,      value
FIELD *,    	                 8, %s,     image,     image=JPEG2, detResidImfile.php,  ARG2
FIELD detResidExp.bg,            8, %s,     backgnd,   value
FIELD detResidExp.bg_mean_stdev, 8, %s,     [stdev]
FIELD detResidExp.bg_stdev,      8, %s,     stdev,     value
FIELD detResidExp.bin_stdev,     8, %s,     bin stdev, value
FIELD *,                         8, %s,     S/N,       op=OP1
FIELD detResidExp.fringe_0,      8, %s,     fringe,    value
FIELD detResidExp.fringe_1,      8, %s,     fringe err, value
FIELD detResidExp.fringe_2,      8, %s,     fringe stdev, value
FIELD detResidExp.user_1,        8, %s,     dfringe,    value
FIELD detResidExp.user_2,        8, %s,     dfringe err, value
FIELD detResidExp.user_3,        8, %s,     dfringe stdev, value
FIELD rawExp.dateobs,            8, %s,     obs date,  value
FIELD rawExp.filter,             8, %s,     filter,    value
FIELD rawExp.exp_time,           8, %s,     exptime,   value
FIELD rawExp.ccd_temp,           8, %s,     ccd temp,  value
FIELD rawExp.airmass,            8, %s,     airmass,   value
FIELD detResidExp.accept,        4, %s,     keep,      value
FIELD detResidExp.path_base,    20, %s,     path_base, none

TD_CLASS list_off $detResidExp.accept == 0
