# this file il
# master detrend runs which have been accepted

TABLE detRunSummary, detRun
TITLE Master Detrend Images
FILE  masterDetrendImages.php
MENU  ipp.detrend.dat

# the following WHERE clauses are added to all queries joined by AND
WHERE detRunSummary.accept = 1
WHERE detRun.det_it = detRunSummary.det_id
WHERE detRun.iteration = detRunSummary.iteration

ARGS  ARG1 det_id=$detRunSummary.det_id
ARGS  ARG1 iteration=$detRunSummary.iteration

#     field                    width name           show         link to           extras
FIELD detRunSummary.det_id,    7,    det_id
FIELD detRun.det_type,         5,    type
FIELD detRunSummary.iteration, 5,    iter
FIELD *,                       20,   choose,       value=input, detInputExp.php,  ARG1
FIELD *,                       20,   choose,       value=resid, detResidExp.php,  ARG1
FIELD detRunSummary.bg,        20,   bg
FIELD detRunSummary.bg_stdev,  20,   bg_stdev
# FIELD bg_mean_stdev, 20,   bg_mean_stdev

# this file illustrates a simple inner join to generate the output table
# assuming no other dynamic restrictions are added, this generates the following query:
# SELECT detRunSummary.det_id,detRunSummary.iteration,detRunSummary.iteration,detRun.det_type,detRunSummary.bg,detRunSummary.bg_stdev \
# FROM detRunSummary, detRun \
# WHERE detRunSummary.accept = 1 AND detRun.det_id = detRunSummary.det_id AND detRun.iteration = detRunSummary.iteration \
# LIMIT 20
