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_tag = rawExp.exp_tag

# 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_tag=$detResidExp.exp_tag

ARGS  ARG2 det_id=$detResidExp.det_id
ARGS  ARG2 iteration=$detResidExp.iteration
ARGS  ARG2 exp_tag=$detResidExp.exp_tag
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_tag, 	15,   Exposure,  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 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
