TABLE detProcessedExp, rawExp
TITLE detProcessedExp
FILE  detProcessedExp_noimage.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_stdev > 0.0 ? $detProcessedExp.bg / $detProcessedExp.bg_stdev : NAN

#     field                    size    	format  name       show          link to                 extras
FIELD detProcessedExp.det_id,     7,   	%d,     Det ID,    value
FIELD rawExp.camera,             10,    %s,     camera,    value
FIELD detProcessedExp.exp_id, 	  5,   	%d,     Exp ID,    value
FIELD rawExp.exp_name, 	          5,   	%s,     Exp Name,  value
FIELD detProcessedExp.fault,      5,   	%d,     Fault,     value
# FIELD *, 	  		  8,   	%s,     image,     image=JPEG2,  detProcessedImfile.php, ARG1
FIELD detProcessedExp.bg, 	  8,   	%.3f,   backgnd,   value
FIELD detProcessedExp.bg_mean_stdev, 8,	%.3f,   [stdev],   value
FIELD detProcessedExp.bg_stdev,   8,   	%.3f,   stdev,     value
FIELD (detProcessedExp.bg/detProcessedExp.bg_stdev), 8, %.3f,   S/N,     value
# FIELD *,                          8,    %.3f,   S/N,       op=OP1
FIELD rawExp.dateobs,            19,   	%T,     obs date,  value
FIELD rawExp.filter,             10,   	%s,     filter,    value
FIELD rawExp.exp_time,            8,   	%.2f,    exptime,   value
FIELD rawExp.ccd_temp,            8,   	%.2f,    ccd temp,  value
FIELD rawExp.airmass,             8,   	%.4f,    airmass,   value
FIELD detProcessedExp.path_base, 20,   	%s,     path_base, none

# TD_CLASS det_off $detProcessedExp.fault > 0

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