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

TD_CLASS list_off $detResidExp.accept == 0
