TABLE stackRun, stackSumSkyfile
TITLE Stack Processed Skyfiles
FILE  stackProcessedSkyfile_Images.php
MENU  ipp.stack.dat

WHERE stackRun.stack_id = stackSumSkyfile.stack_id
WHERE stackRun.state = 'full'
WHERE stackSumSkyfile.fault = 0

# define image names to be used below
# IMAGE VAR basename filerule camera class_id
IMAGE JPEG2 $stackSumSkyfile.path_base PPSTACK.OUTPUT.JPEG2 GPC1 NONE

ARGS  ARG7 stackRun.stack_id=$stackRun.stack_id
ARGS  ARG7 stackRun.skycell_id=$stackRun.skycell_id
ARGS  ARG7 camera=GPC1
ARGS  ARG7 basename=$stackSumSkyfile.path_base

#        field                   size  format  name           show     link to         extras
FIELD stackRun.stack_id,            5, %d,     Stack ID
FIELD stackRun.skycell_id,          5, %s,     Skycell ID
FIELD stackRun.label,    	    5, %s,     Label
FIELD stackRun.data_group,    	    5, %s,     data grp
FIELD stackRun.dist_group,    	    5, %s,     dist grp
FIELD stackSumSkyfile.quality,      5, %d,     quality
FIELD *,    	                    8, %s,     image,         image=JPEG2, stackProcessedSkyfile_Images.php,  ARG7
FIELD stackRun.filter,    	    5, %s,     Filter
FIELD stackRun.tess_id,    	    5, %s,     Tess ID
FIELD stackRun.state,    	    7, %s,     State
FIELD stackSumSkyfile.bg,           5, %.2f,   backgnd
FIELD stackSumSkyfile.bg_stdev,     5, %.2f,   stdev    
FIELD stackSumSkyfile.dtime_stack,  5, %.2f,   t(stack)
FIELD stackSumSkyfile.dtime_match_mean, 5, %.2f, t(match)
FIELD stackSumSkyfile.dtime_initial, 5, %.2f,   t(initial)
FIELD stackSumSkyfile.dtime_reject,  5, %.2f,   t(reject)
FIELD stackSumSkyfile.dtime_final,   5, %.2f,   t(final)
FIELD stackSumSkyfile.dtime_phot,    5, %.2f,   t(phot)
FIELD stackSumSkyfile.dtime_script,  5, %.2f,   t(script)

FIELD stackSumSkyfile.match_mean,    5, %.2f,   match
FIELD stackSumSkyfile.match_stdev,   5, %.2f,   match err

FIELD stackSumSkyfile.reject_images, 5, %d,   n(reject)
FIELD stackSumSkyfile.sources,       5, %d,   n(sources)

FIELD stackSumSkyfile.path_base,    5, %s,     path_base,     none

TAIL PHP insert_image ('PPSTACK.OUTPUT.JPEG1', 'width=90%');
TAIL PHP insert_log ('LOG.EXP');
