Index: /trunk/ippMonitor/Makefile.in
===================================================================
--- /trunk/ippMonitor/Makefile.in	(revision 31815)
+++ /trunk/ippMonitor/Makefile.in	(revision 31816)
@@ -33,4 +33,6 @@
 $(DESTWWW)/ipp.dist.dat \
 $(DESTWWW)/ipp.dist.php \
+$(DESTWWW)/ipp.lap.dat \
+$(DESTWWW)/ipp.lap.php \
 $(DESTWWW)/ipp.imfiles.dat \
 $(DESTWWW)/ipp.imfiles.php \
@@ -70,7 +72,4 @@
 $(DESTWWW)/version.php \
 $(DESTWWW)/show_log.php 
-
-
-
 
 DEFSRC = \
@@ -223,7 +222,9 @@
 $(DESTWWW)/minidvodbProcessed.php \
 $(DESTWWW)/addRunRun.php \
-$(DESTWWW)/addRunProcessed.php
-
-
+$(DESTWWW)/addRunProcessed.php \
+$(DESTWWW)/lapSequenceSummary.php \
+$(DESTWWW)/lapRuns.php \
+$(DESTWWW)/lapExposures.php \
+$(DESTWWW)/lapStacks.php
 
 PICTURES = \
@@ -274,4 +275,8 @@
 	rm -f $(DESTWWW)/version.php
 
+test:
+#DESTWWW := $(DESTWWW)/test
+	echo $(DESTWWW)
+
 $(DESTWWW)/version.php:
 	svnversion > $@
Index: /trunk/ippMonitor/def/lapExposures.d
===================================================================
--- /trunk/ippMonitor/def/lapExposures.d	(revision 31816)
+++ /trunk/ippMonitor/def/lapExposures.d	(revision 31816)
@@ -0,0 +1,60 @@
+TABLE lapRun LEFT JOIN lapExp USING(lap_id) LEFT JOIN rawExp USING(exp_id,filter) LEFT JOIN chipRun AS chipRun1 USING(chip_id) LEFT JOIN camRun AS camRun1 ON camRun1.chip_id=chipRun1.chip_id LEFT JOIN fakeRun AS fakeRun1 ON fakeRun1.cam_id=camRun1.cam_id LEFT JOIN warpRun AS warpRun1 ON warpRun1.fake_id=fakeRun1.fake_id LEFT JOIN chipRun AS chipRun2 ON chipRun2.chip_id=lapExp.pair_id LEFT JOIN camRun AS camRun2 ON camRun2.chip_id=chipRun2.chip_id LEFT JOIN fakeRun AS fakeRun2 ON fakeRun2.cam_id=camRun2.cam_id LEFT JOIN warpRun AS warpRun2 ON warpRun2.fake_id=fakeRun2.fake_id LEFT JOIN diffInputSkyfile ON diffInputSkyfile.warp1=warpRun1.warp_id AND diffInputSkyfile.warp2=warpRun2.warp_id LEFT JOIN diffRun USING(diff_id)
+TITLE LAP Exposures
+FILE  lapExposures.php
+MENU  ipp.lap.dat
+
+UNRESTRICTED WHERE 0=1
+
+ARGS  ARG1	rawImfile.exp_id=$lapExp.exp_id
+ARGS  ARG2	chipRun.chip_id=$lapExp.chip_id
+ARGS  ARG3	chipRun.chip_id=$lapExp.pair_id
+ARGS  ARG4	camRun.cam_id=$camRun1.cam_id
+ARGS  ARG5	camRun.cam_id=$camRun2.cam_id
+ARGS  ARG6	fakeRun.fake_id=$fakeRun1.fake_id
+ARGS  ARG7	fakeRun.fake_id=$fakeRun2.fake_id
+ARGS  ARG8	warpRun.warp_id=$warpRun1.warp_id
+ARGS  ARG9	warpRun.warp_id=$warpRun2.warp_id
+ARGS  ARG10	diffRun.diff_id=$diffRun.diff_id
+
+#     field                   size  format  name         show    link to                  extras
+FIELD lapRun.seq_id,          6, %d,     seq_id
+FIELD lapExp.lap_id,          6, %d,     lap_id
+FIELD lapExp.data_state,      6, %s,     State (lapExp)
+FIELD lapExp.exp_id,          6, %d,     Exp ID,	value, rawImfile.php, ARG1
+FIELD lapExp.chip_id,         6, %d,     Chip1 (lapExp.chip_id),	value, chipStageExp.php, ARG2
+FIELD chipRun1.state AS ch1state,          6, %s,    Chip1 State
+FIELD camRun1.cam_id AS cam_id_1,         6, %d,     Cam1 ID,	value, camStageExp.php, ARG4
+FIELD camRun1.state AS ca1state,          6, %s,     Cam1 State
+FIELD fakeRun1.fake_id AS fake_id_1,         6, %d,     Fake1 ID,	value, fakeStageExp.php, ARG6
+FIELD fakeRun1.state AS fa1state,          6, %s,     Fake1 State
+FIELD warpRun1.warp_id AS warp_id_1,         6, %d,     Warp1 ID,	value, warpStageExp.php, ARG8
+FIELD warpRun1.state AS wa1state,          6, %s,     Warp1 State
+FIELD lapExp.pair_id,         6, %d,     Chip2 ID (lapExp.chip_id),	value, chipStageExp.php, ARG3
+FIELD chipRun2.state AS ch2state,          6, %s,    Chip2 State
+FIELD camRun2.cam_id AS cam_id_2,         6, %d,     Cam2 ID,	value, camStageExp.php, ARG5
+FIELD camRun2.state AS ca2state,          6, %s,     Cam2 State
+FIELD fakeRun2.fake_id AS fake_id_2,         6, %d,     Fake2 ID,	value, fakeStageExp.php, ARG7
+FIELD fakeRun2.state AS fa2state,          6, %s,     Fake2 State
+FIELD warpRun2.warp_id AS warp_id_2,         6, %d,     Warp2 ID,	value, warpStageExp.php, ARG9
+FIELD warpRun2.state AS wa2state,          6, %s,     Warp2 State
+FIELD diffRun.diff_id,          6, %d,     Diff ID,	value, diffStageExp.php, ARG10
+FIELD diffRun.state AS diState,          6, %s,     Diff State
+FIELD lapRun.tess_id,         8, %s,     tess_id
+FIELD lapRun.projection_cell, 10, %s,    ProjCell
+FIELD lapRun.filter,          7, %s,     Filter
+FIELD lapRun.state,           15, %s,    State (lapRun)
+FIELD lapRun.label,           15, %s,    Label
+FIELD lapRun.dist_group,      15, %s,    Dist Group
+FIELD lapRun.registered,      19, %T,    Registered
+FIELD lapRun.fault,           3, %d,     fault
+FIELD lapRun.quick_sass_id,   6, %d,     quick_sass_id
+FIELD lapRun.final_sass_id,   6, %d,     final_sass_id
+FIELD lapExp.private,         2, %d,     Private
+FIELD lapExp.pairwise,        2, %d,     Pairwise
+FIELD lapExp.active,          2, %d,     Active
+FIELD rawExp.dateobs,         19, %T,     Date/Time
+FIELD rawExp.object, 	      8, %s,     Object
+FIELD rawExp.comment, 	      80, %s,	 Comment
+
+# MODE summary
+# GROUP diff_id
Index: /trunk/ippMonitor/def/lapRuns.d
===================================================================
--- /trunk/ippMonitor/def/lapRuns.d	(revision 31816)
+++ /trunk/ippMonitor/def/lapRuns.d	(revision 31816)
@@ -0,0 +1,20 @@
+TABLE lapRun
+TITLE LAP Runs
+FILE  lapRuns.php
+MENU  ipp.lap.dat
+
+ARGS  ARG1	lapExp.lap_id=$lapRun.lap_id
+ARGS  ARG2	lapRun.lap_id=$lapRun.lap_id
+
+#     field                   size  format  name         show    link to                  extras
+FIELD lapRun.seq_id,          6, %d,     seq_id
+FIELD lapRun.lap_id,          6, %d,     lap_id, value, lapExposures.php, ARG1
+FIELD lapRun.tess_id,         15, %s,    tess_id
+FIELD lapRun.projection_cell, 15, %s,    projection_cell
+FIELD lapRun.filter,          15, %s,    filter
+FIELD lapRun.state,           15, %s,    state
+FIELD lapRun.label,           15, %s,    label
+FIELD lapRun.dist_group,      15, %s,    dist_group
+FIELD lapRun.fault,           3, %d,     fault
+FIELD lapRun.quick_sass_id,   6, %d,     quick_sass_id, value, lapStacks.php, ARG2
+FIELD lapRun.final_sass_id,   6, %d,     final_sass_id, value, lapStacks.php, ARG2
Index: /trunk/ippMonitor/def/lapSequenceSummary.d
===================================================================
--- /trunk/ippMonitor/def/lapSequenceSummary.d	(revision 31816)
+++ /trunk/ippMonitor/def/lapSequenceSummary.d	(revision 31816)
@@ -0,0 +1,11 @@
+TABLE lapSequence
+TITLE LAP Sequence Summary
+FILE  lapSequenceSummary.php
+MENU  ipp.lap.dat
+
+ARGS  ARG1	lapRun.seq_id=$lapSequence.seq_id
+
+#     field                   size  format  name         show    link to                  extras
+FIELD lapSequence.seq_id,          6, %d,     seq_id, value, lapRuns.php, ARG1
+FIELD lapSequence.name,          25, %s,     Name, value, lapRuns.php, ARG1
+FIELD lapSequence.description,          80, %s,     Description, value, lapRuns.php, ARG1
Index: /trunk/ippMonitor/def/lapStacks.d
===================================================================
--- /trunk/ippMonitor/def/lapStacks.d	(revision 31816)
+++ /trunk/ippMonitor/def/lapStacks.d	(revision 31816)
@@ -0,0 +1,37 @@
+TABLE lapRun LEFT JOIN stackAssociationMap AS stackAssociationMap1 ON stackAssociationMap1.sass_id=lapRun.quick_sass_id LEFT JOIN stackRun AS stackRun1 ON stackRun1.stack_id=stackAssociationMap1.stack_id LEFT JOIN stackSumSkyfile AS stackSumSkyfile1 ON stackSumSkyfile1.stack_id=stackAssociationMap1.stack_id LEFT JOIN stackAssociationMap AS stackAssociationMap2 ON stackAssociationMap2.sass_id=lapRun.final_sass_id LEFT JOIN stackRun AS stackRun2 ON stackRun2.stack_id=stackAssociationMap2.stack_id LEFT JOIN stackSumSkyfile AS stackSumSkyfile2 ON stackSumSkyfile2.stack_id=stackAssociationMap2.stack_id 
+TITLE LAP Stacks
+FILE  lapStacks.php
+MENU  ipp.lap.dat
+
+UNRESTRICTED WHERE 0=1
+
+ARGS  ARG1	stackRun.stack_id=$stackRun1.stack_id
+ARGS  ARG2	stackRun.stack_id=$stackRun2.stack_id
+
+#     field                   size  format  name         show    link to                  extras
+FIELD lapRun.seq_id,          6, %d,     seq_id
+FIELD lapRun.lap_id,          6, %d,     lap_id
+FIELD lapRun.tess_id,         8, %s,     tess_id
+FIELD lapRun.projection_cell, 10, %s,    ProjCell
+FIELD lapRun.filter,          7, %s,     Filter
+FIELD lapRun.state,           6, %s,    State (lapRun)
+FIELD lapRun.label,           15, %s,    Label
+FIELD lapRun.dist_group,      15, %s,    Dist Group
+FIELD lapRun.registered,      19, %T,    Registered
+FIELD lapRun.fault,           3, %d,     fault
+# FIELD stackRun.skycell_id,    15, %s,	 Skycell ID
+FIELD lapRun.quick_sass_id,   	6, %d, 	 Quick SASS ID
+FIELD stackRun1.stack_id AS quick_stack_id,	6, %d, 	 Quick Stack ID, value, stackProcessedSkyfile_Images.php, ARG1
+FIELD stackRun1.data_group AS quick_data_group,	15, %s,  Quick Data Group
+FIELD stackRun1.state AS quick_state,	6, %s,     Quick State
+FIELD stackSumSkyfile1.fault AS quick_fault,	6, %d,     Quick Fault
+FIELD stackSumSkyfile1.quality AS quick_quality,	6, %d,     Quick Quality    
+FIELD lapRun.final_sass_id,	6, %d, 	 Final SASS ID	    
+FIELD stackRun2.stack_id AS final_stack_id,	6, %d, 	 Final Stack ID,, value, stackProcessedSkyfile_Images.php, ARG2
+FIELD stackRun2.data_group AS final_data_group,	15, %s,    Final Data Group 
+FIELD stackRun2.state AS final_state,	6, %s,     Final State	    
+FIELD stackSumSkyfile2.fault AS final_fault,	6, %d,     Final Fault	    
+FIELD stackSumSkyfile2.quality AS final_quality,	6, %d,     Final Quality    
+
+# MODE summary
+# GROUP lapRun.quick_sass_id
Index: /trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_labels.php	(revision 31815)
+++ /trunk/ippMonitor/raw/czartool_labels.php	(revision 31816)
@@ -135,5 +135,5 @@
 echo "<tr><td>Postage stamp server status</td><td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\"><font color=\"blue\">here</font></a></td></tr>";
 echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\"><font color=\"blue\">here</font></a></td></tr>";
-echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\"><font color=\"blue\">here</font></a></td></tr>";
+echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\"><font color=\"blue\">here</font></a></td></tr>";
 echo "<tr><td>Who's using the cluster?</td><td><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\"><font color=\"blue\">here</font></a></td></tr>";
 echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>";
Index: /trunk/ippMonitor/raw/ipp.lap.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.lap.dat	(revision 31816)
+++ /trunk/ippMonitor/raw/ipp.lap.dat	(revision 31816)
@@ -0,0 +1,7 @@
+input     | ipp.menu.dat 
+
+menutop   | menutop      | plain   | &nbsp;                       | 
+menulink  | menuselect   | link    | Sequence Summary             | lapSequenceSummary.php
+menulink  | menuselect 	 | link    | LAP Runs                     | lapRuns.php            
+menulink  | menuselect 	 | link    | LAP Exposures                | lapExposures.php            
+menulink  | menuselect 	 | link    | LAP Stacks                   | lapStacks.php            
Index: /trunk/ippMonitor/raw/ipp.lap.php
===================================================================
--- /trunk/ippMonitor/raw/ipp.lap.php	(revision 31816)
+++ /trunk/ippMonitor/raw/ipp.lap.php	(revision 31816)
@@ -0,0 +1,17 @@
+<?php 
+
+include 'ipp.php';
+
+$ID = checkID ();
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+menu('ipp.lap.dat', 'Large Area Processing', 'ipp.css', $ID['link'], $ID['proj']);
+
+// document body
+echo "Large Area Processing<br>\n";
+
+menu_end();
+
+?>
Index: /trunk/ippMonitor/raw/ipp.menu.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.menu.dat	(revision 31815)
+++ /trunk/ippMonitor/raw/ipp.menu.dat	(revision 31816)
@@ -23,7 +23,7 @@
 menutop   | menutop      | link    | Stack Steps                  | ipp.stack.php
 menutop   | menutop      | link    | Distribution                 | ipp.dist.php
+menutop   | menutop      | link    | Large Area Processing        | ipp.lap.php
 menutop   | menutop      | link    | dvoDB                        | ipp.dvodb.php
 menutop   | menutop      | link    | Calibration                  | ipp.cal.php
 menutop   | menutop      | link    | Plots              	  | ipp.plots.php
 menutop   | menutop      | link    | Admin and Debug              | ipp.imfiles.php
-
Index: /trunk/ippMonitor/scripts/generate
===================================================================
--- /trunk/ippMonitor/scripts/generate	(revision 31815)
+++ /trunk/ippMonitor/scripts/generate	(revision 31816)
@@ -61,7 +61,16 @@
             if ($field =~ m|\S+\s+as\s+\S+|) {
                 ($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
+		#print STDERR "Case 1\n";
+            } elsif ($field =~ m|\S+\s+AS\s+\S+|) {
+		#print STDERR "field=$field\n";
+		$fieldreal = $field;
+		$fieldreal =~ s/\s+AS.*$//;
+                #($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
+		#print STDERR "Case 2\n";
             } else {
                 $fieldreal = $field;
+		#print STDERR "Case 3\n";
             }
+	    #print STDERR "field=[$field]\tfieldreal=[$fieldreal]\n";
 
             if ($VERBOSE) { printf "%-20s %-20s %-20s %-20s %-20s %-20s\n", $field, $name, $format, $show, $link, $extras; }
@@ -527,5 +536,7 @@
     @extfields = split (/,/, $extras);
     for ($i = 0; $i < @extfields; $i++) {
+	# print STDERR $extfields[$i],"\n";
         ($label, $value, $outline) = &parse_label ($extfields[$i]);
+	# print STDERR "[",$label,"]","[",$value,"]","[",$outline,"\n";
         print FILE "  \$link = \$link . \"&$outline\";\n";
     }
@@ -540,12 +551,21 @@
     ($word, $value) = split (" ", $_[0]);
 
+    # print STDERR "#############################\n";
+    # foreach my $key ( keys %linkarg ) {
+    # 	print STDERR "key: $key, value: $linkarg{$key}\n";
+    # }
+
     # print STDERR "0: $_[0], $word, $value\n";
+    # print STDERR "[$linkarg{$word}]\n";
 
     if ($linkarg{$word}) {
+	# print STDERR "Case 1\n";
         $linkarg{$word} = "$linkarg{$word},$value";
     } else {
+	# print STDERR "Case 2\n";
         $linkarg{$word} = $value;
     }
     # print STDERR "linkarg($word) : $linkarg{$word}\n";
+    # print STDERR "#############################\n";
 }
 
@@ -563,8 +583,20 @@
     $value = "";
 
+    # print STDERR "### parse_label ###\n";
+    # for ($i = 0; $i < @field; $i++) {
+    # 	print STDERR "field[$i]=$field[$i]\n";
+    # }
+    # for ($i = 0; $i < @fieldreal; $i++) {
+    # 	print STDERR "fieldreal[$i]=$fieldreal[$i]\n";
+    # }
+    # for ($i = 0; $i < @count; $i++) {
+    # 	print STDERR "count[$i]=$count[$i]\n";
+    # }
+
     # search for embedded table fields and replace with row[N]
     if ($VERBOSE) { print STDERR "string: $string\n"; }
     if ($string =~ m|\S+=\S+|) {
         ($label, $value) = $string =~ m|(\S+)=(\S+)|;
+	# print STDERR "value=$value\n";
         if ($value =~ m|^\$|) {
           MATCH_LABEL:
@@ -572,11 +604,11 @@
                 if ($field[$i] eq "*") { next; }
                 while ($value =~ m|\$$fieldreal[$i]|) {
-                    # print "field: $fieldreal[$i]\n";
+                    # print STDERR "field: $fieldreal[$i]\n";
                     # ($part1, $name, $part2) = $value =~ m|\$($fieldreal[$i])\@(\S+)|;
                     ($part1, $name, $part2) = $value =~ m|(\S*)\$($fieldreal[$i])(\S*)|;
-                    # print "name: $name\n";
-                    # print "part1: $part1\n";
-                    # print "part2: $part2\n";
-                    # print "value: $value\n";
+                    # print STDERR "name: $name\n";
+                    # print STDERR "part1: $part1\n";
+                    # print STDERR "part2: $part2\n";
+                    # print STDERR "value: $value\n";
 
                     $Nrow = $count[$i];
@@ -587,5 +619,5 @@
                     #     $value = "\$row[$Nrow]";
                     # }
-                    # print "outval: $value\n";
+                    # print STDERR  "outval: $value\n";
                     # last MATCH_LABEL;
                 }
