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

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

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

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

OP    OP1  $detProcessedExp.bg / $detProcessedExp.bg_stdev

#     field                    size    	format  name       show          link to                 extras
FIELD detProcessedExp.det_id,     7,   	%s,     Det ID,    value
FIELD rawExp.camera,             10,    %s,     camera,    value
FIELD detProcessedExp.exp_id, 	  5,   	%s,     Exp ID,    value
FIELD rawExp.exp_name, 	          5,   	%s,     Exp Name,  value
FIELD *, 	  		  8,   	%s,     image,     image=JPEG2,  detProcessedImfile.php, ARG1
FIELD detProcessedExp.bg, 	  8,   	%s,     backgnd,   value
FIELD detProcessedExp.bg_mean_stdev, 8,	%s,     [stdev],   value
FIELD detProcessedExp.bg_stdev,   8,   	%s,     stdev,     value
FIELD *,                          8,    %s,     S/N,       op=OP1
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 detProcessedExp.path_base, 20,   	%s,     path_base, none

# note: you must include all desired fields, where ever they are used,
# in FIELD
