Index: trunk/ippMonitor/Makefile.in
===================================================================
--- trunk/ippMonitor/Makefile.in	(revision 28652)
+++ trunk/ippMonitor/Makefile.in	(revision 28654)
@@ -144,4 +144,5 @@
 $(DESTWWW)/warpFailedSkyfiles.php \
 $(DESTWWW)/diffSummary.php \
+$(DESTWWW)/diffSummary_Images.php \
 $(DESTWWW)/diffRun.php \
 $(DESTWWW)/diffInputSkyfile.php \
@@ -151,4 +152,5 @@
 $(DESTWWW)/stackRun.php \
 $(DESTWWW)/stackSummary.php \
+$(DESTWWW)/stackSummary_Images.php \
 $(DESTWWW)/stackInputSkyfile.php \
 $(DESTWWW)/stackProcessedSkyfile.php \
Index: trunk/ippMonitor/def/diffSummary_Images.d
===================================================================
--- trunk/ippMonitor/def/diffSummary_Images.d	(revision 28654)
+++ trunk/ippMonitor/def/diffSummary_Images.d	(revision 28654)
@@ -0,0 +1,52 @@
+TABLE diffRun, diffSkyfile, diffSummary
+TITLE Diff Summary w/ Images
+FILE  diffSummary_Images.php
+MENU  ipp.stack.dat
+
+WHERE diffRun.diff_id             = diffSkyfile.diff_id
+WHERE diffSummary.diff_id = diffRun.diff_id
+# WHERE diffRun.state = 'full'
+# WHERE diffSkyfile.fault = 0
+
+# define image names to be used below
+# IMAGE VAR basename filerule camera class_id
+IMAGE JPEG2 OP3 PPSKYCELL.JPEG2 GPC1 NONE
+OP   OP3  $diffSummary.path_base . $diffSummary.projection_cell
+ARGS ARG7 name=$diffSummary.path_base.$diffSummary.projection_cell
+ARGS ARG7 rule=PPSKYCELL.JPEG1
+ARGS ARG7 camera=GPC1
+ARGS ARG7 class_id=NONE
+
+# XXX need to get camera from lookup
+ARGS  ARG7 diffSkyfile.diff_id=$diffSkyfile.diff_id
+ARGS  ARG7 diffSkyfile.skycell_id=$diffSkyfile.skycell_id
+ARGS  ARG7 camera=GPC1
+ARGS  ARG7 basename=$diffSkyfile.path_base
+
+#     field                         size  format  name           show     link to         extras
+FIELD diffSkyfile.diff_id,             5, %d,     Diff ID
+FIELD diffSkyfile.skycell_id,          5, %s,     Skycell ID
+FIELD diffRun.label,    	       5, %s,     Label
+FIELD diffRun.data_group,    	       5, %s,     data grp
+FIELD diffRun.dist_group,    	       5, %s,     dist grp
+FIELD *,    	                       8, %s,     image, image=JPEG2, getimage.php, ARG7
+# FIELD diffRun.filter,    	       5, %s,     Filter
+FIELD diffRun.tess_id,    	       5, %s,     Tess ID
+FIELD diffRun.state,    	       7, %s,     State,         value,   diffProcessedSkyfile.php, ARG7
+FIELD diffSkyfile.bg,                  5, %.2f,   backgnd
+FIELD diffSkyfile.bg_stdev,            5, %.2f,   stdev    
+FIELD diffSkyfile.dtime_diff,          5, %.2f,   t(diff)
+FIELD diffSkyfile.dtime_match,         5, %.2f,   t(match)
+FIELD diffSkyfile.dtime_phot,          5, %.2f,   t(phot)
+FIELD diffSkyfile.dtime_script,        5, %.2f,   t(script)
+FIELD diffSkyfile.stamps_num,          5, %d,     n(stamps)
+FIELD diffSkyfile.stamps_mean,         5, %.2f,   mean(stamps)
+FIELD diffSkyfile.stamps_rms,          5, %.2f,   rms(stamps)
+FIELD diffSkyfile.sources,             5, %d,     n(sources)
+FIELD diffSkyfile.path_base,           5, %s,     path_base,     none
+
+FIELD diffSummary.path_base,           5, %s,     path_base,     none
+FIELD diffSummary.projection_cell,     5, %s,     projection_cell,     none
+
+# TAIL PHP insert_image ('PPSUB.OUTPUT.JPEG1', 'width=90%');
+TAIL PHP insert_log ('LOG.EXP');
Index: trunk/ippMonitor/def/stackSummary_Images.d
===================================================================
--- trunk/ippMonitor/def/stackSummary_Images.d	(revision 28654)
+++ trunk/ippMonitor/def/stackSummary_Images.d	(revision 28654)
@@ -0,0 +1,56 @@
+TABLE stackRun, stackSumSkyfile, stackAssociationMap, stackSummary
+TITLE Stack Summary Summary w/ Images
+FILE  stackSummary_Images.php
+MENU  ipp.stack.dat
+
+WHERE stackRun.stack_id = stackSumSkyfile.stack_id
+WHERE stackRun.state = 'full'
+WHERE stackSumSkyfile.fault = 0
+
+# TODO
+WHERE stackSummary.sass_id = stackAssociationMap.sass_id
+WHERE stackAssociationMap.stack_id = stackRun.stack_id
+
+# define image names to be used below
+# IMAGE VAR basename filerule camera class_id
+IMAGE JPEG2 OP1 PPSKYCELL.JPEG2 GPC1 NONE
+OP   OP1  $stackSummary.path_base . $stackSummary.projection_cell
+ARGS ARG7 name=$stackSummary.path_base.$stackSummary.projection_cell
+ARGS ARG7 rule=PPSKYCELL.JPEG1
+ARGS ARG7 camera=GPC1
+ARGS ARG7 class_id=NONE
+
+#        field                   size  format  name           show     link to         extras
+FIELD stackRun.stack_id,            5, %s,     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 *,    	                    8, %s,     image,   image=JPEG2, getimage.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 stackSummary.path_base,    5, %s,     path_base,     none
+FIELD stackSummary.projection_cell,    5, %s,     projection_cell,     none
+
+FIELD stackAssociationMap.sass_id,    5, %s,  sAMsai   ,     none
+FIELD stackAssociationMap.stack_id,    5, %s,  sAMsti   ,     none
+
+TAIL PHP insert_image ('PPSTACK.OUTPUT.JPEG1', 'width=90%');
+TAIL PHP insert_log ('LOG.EXP');
Index: trunk/ippMonitor/def/warpStageExp.d
===================================================================
--- trunk/ippMonitor/def/warpStageExp.d	(revision 28652)
+++ trunk/ippMonitor/def/warpStageExp.d	(revision 28654)
@@ -1,11 +1,18 @@
-TABLE warpRun, fakeRun, camRun, chipRun, rawExp
+TABLE warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary
 TITLE Warp Stage Exposures
 FILE  warpStageExp.php
 MENU  ipp.science.dat
 
+#
+# Images pathnames are extracted from warpSummary
+# using ipp_filename.pl with basename:
+#   $warpSummary.path_base . $warpSummary.projection_cell
+# . is the string concatenation operator
+#
 WHERE warpRun.fake_id = fakeRun.fake_id
 WHERE fakeRun.cam_id = camRun.cam_id
 WHERE camRun.chip_id = chipRun.chip_id
 WHERE chipRun.exp_id = rawExp.exp_id
+WHERE warpSummary.warp_id = warpRun.warp_id
 
 ARGS  ARG1  rawImfile.exp_id=$rawExp.exp_id
@@ -17,4 +24,18 @@
 OP   OP1  $rawExp.ra * 57.295783
 OP   OP2  $rawExp.decl * 57.295783
+OP   OP3  $warpSummary.path_base . $warpSummary.projection_cell
+
+# define image names to be used below
+# IMAGE VAR basename filerule camera class_id
+# ARGS  ARG6 warpRun.warp_id=$warpRun.warp_id
+# ARGS  ARG6 warpSummary.skycell_id=$warpSummary.skycell_id
+# ARGS  ARG6 camera=$rawExp.camera
+# ARGS  ARG6 basename=$warpSkyfile.path_base
+IMAGE JPEG3 OP3 PPSKYCELL.JPEG2 $rawExp.camera NONE
+ARGS ARG7 name=$warpSummary.path_base.$warpSummary.projection_cell
+ARGS ARG7 rule=PPSKYCELL.JPEG1
+ARGS ARG7 camera=GPC1
+ARGS ARG7 class_id=NONE
+
 
 #     field                   size  format  name         show    link to         extras
@@ -25,4 +46,5 @@
 FIELD fakeRun.fake_id,    	 7, %d,     Fake ID,      value,  fakeProcessedImfile.php, ARG4
 FIELD warpRun.warp_id,    	 7, %d,     Warp ID,      value,  warpStageExp.php,        ARG5
+FIELD *,                         8, %s,     image,        image=JPEG3, getimage.php,  ARG7
 FIELD warpRun.state,    	 7, %s,     state
 FIELD warpRun.label,    	 7, %s,     label
@@ -42,4 +64,7 @@
 FIELD rawExp.comment,  	        65, %s,     Comment
 
+FIELD warpSummary.path_base,      5, %s,     path_base,   none
+FIELD warpSummary.projection_cell,      5, %s,     projection_cell,   none
+
 # FIELD rawExp.bg_mean_stdev,  	 5, %7.2f,  &lt;backgnd&gt;
 # FIELD chipPendingExp.reduction,    20,   reduction
Index: trunk/ippMonitor/raw/columns_in_db.php
===================================================================
--- trunk/ippMonitor/raw/columns_in_db.php	(revision 28652)
+++ trunk/ippMonitor/raw/columns_in_db.php	(revision 28654)
@@ -31,4 +31,5 @@
 	    6 => "warpRun",
 	    7 => "warpSkyCellMap",
+	    8 => "warpSummary",
 		     );
 
Index: trunk/ippMonitor/raw/getimage.php
===================================================================
--- trunk/ippMonitor/raw/getimage.php	(revision 28652)
+++ trunk/ippMonitor/raw/getimage.php	(revision 28654)
@@ -11,4 +11,5 @@
 // global $PSCONFIG
 
+
 ### these need to be set to the correct locations!!
 $MISSING = "missing.png";
@@ -20,5 +21,4 @@
 }
 
-
 putenv("PSCONFDIR=$PSCONFDIR");
 putenv("PSCONFIG=$PSCONFIG");
@@ -28,8 +28,10 @@
 
 if ($debug) {
+  echo "DEBUG1<br>";
   echo "args: $args<br>";
   echo "path: $PATH<br>";
   echo "perl: $PERLLIB<br>";
   echo "bindir: $BINDIR<br>";
+  echo "site=$SITE<br>\n";
 }
 
@@ -43,4 +45,5 @@
 
 if ($debug) {
+  echo "DEBUG2<br>";
   echo "basename: $basename<br>";
   echo "filerule: $filerule<br>";
@@ -64,6 +67,8 @@
 
 if ($debug) {
-  exec ("which ipp_filename.pl", $output, $status);
-  echo "which ipp_filename.pl output:<br>";
+  echo "DEBUG3<br>";
+  $output = array();
+  exec ("which $BINDIR/ipp_filename.pl", $output, $status);
+  echo "which $BINDIR/ipp_filename.pl output:<br>";
   for ($i = 0; $i < count($output); $i++) {
     echo "output $i: $output[$i]<br>";
@@ -71,4 +76,5 @@
   echo "status:   $status<br>";
 
+  $output = array();
   exec ("whoami", $output, $status);
   echo "which whoami output:<br>";
@@ -79,5 +85,7 @@
 }
 
-exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id", $output, $status);
+/* --site=$SITE */
+$output = array();
+exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id 2> /tmp/errors", $output, $status);
 
 # use these to check the environment
@@ -91,9 +99,10 @@
 
 if ($debug) {
+  echo "DEBUG4<br>";
+  echo "Command = ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id<br>\n";
   echo "basename: $basename<br>";
   for ($i = 0; $i < count($output); $i++) {
     echo "output $i: $output[$i]<br>";
   }
-  echo "output:   $output[0]<br>";
   echo "status:   $status<br>";
   echo "filename: $filename<br>";
Index: trunk/ippMonitor/raw/ipp.science.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.science.dat	(revision 28652)
+++ trunk/ippMonitor/raw/ipp.science.dat	(revision 28654)
@@ -36,5 +36,4 @@
 menulink  | menuselect   | link    | Warp Skyfile Inputs          | warpStageSkyfileInputs.php
 menulink  | menuselect   | link    | Warp Processed Skyfiles      | warpProcessedSkyfiles.php
-# menulink  | menuselect   | link    | Warp Processed Skyfiles      | warpProcessedSkyfiles_Images.php
 menulink  | menuselect   | link    | Warp Failed Skyfiles         | warpFailedSkyfiles.php
 
Index: trunk/ippMonitor/raw/ipp.stack.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.stack.dat	(revision 28652)
+++ trunk/ippMonitor/raw/ipp.stack.dat	(revision 28654)
@@ -3,4 +3,5 @@
 menutop   | menutop      | plain   | &nbsp;                       | 
 menulink  | menuselect   | link    | Stack Summary                | stackSummary.php
+menulink  | menuselect   | link    | Stack Summary w/ Images        | stackSummary_Images.php
 menulink  | menuselect   | link    | Stack Run                    | stackRun.php
 menulink  | menuselect   | link    | Stack Input Skyfile          | stackInputSkyfile.php
@@ -11,4 +12,5 @@
 menutop   | menutop      | plain   | &nbsp;                       | 
 menulink  | menuselect   | link    | Diff Summary                 | diffSummary.php
+menulink  | menuselect   | link    | Diff Summary w/ Images       | diffSummary_Images.php
 menulink  | menuselect   | link    | Diff Run                     | diffRun.php
 menulink  | menuselect   | link    | Diff Input Skyfile           | diffInputSkyfile.php
Index: trunk/ippMonitor/scripts/generate
===================================================================
--- trunk/ippMonitor/scripts/generate	(revision 28652)
+++ trunk/ippMonitor/scripts/generate	(revision 28654)
@@ -162,10 +162,10 @@
     }
 
+    foreach $opword (@opwords) {
+        &parse_opwords ($opword);
+    }
+
     foreach $imagedef (@imagedefs) {
         &parse_imagedef ($imagedef);
-    }
-
-    foreach $opword (@opwords) {
-        &parse_opwords ($opword);
     }
 
@@ -446,4 +446,5 @@
             next;
         }
+
     }
 }
@@ -625,4 +626,9 @@
     ($var, $name, $rule, $camera, $class) = split (" ", $value);
     $name   = &parse_fieldname ($name);
+    if (exists $ops{$name}) {
+	#if OPx was defined, replace it by its value
+	$name = $ops{$name};
+	$name =~ s/\s+//g;
+    }
     $camera = &parse_fieldname ($camera);
     $class  = &parse_fieldname ($class);
