Index: /trunk/ippMonitor/Makefile.in
===================================================================
--- /trunk/ippMonitor/Makefile.in	(revision 28687)
+++ /trunk/ippMonitor/Makefile.in	(revision 28688)
@@ -62,5 +62,7 @@
 $(DESTWWW)/plotHistogram.php \
 $(DESTWWW)/columns_in_db.php \
-$(DESTWWW)/cleanTmpDirectory.php
+$(DESTWWW)/cleanTmpDirectory.php \
+$(DESTWWW)/warpProcessedExp_Images.php \
+$(DESTWWW)/warpProcessedExp.php
 
 DEFSRC = \
@@ -211,5 +213,6 @@
 $(DESTWWW)/up.png \
 $(DESTWWW)/up_sel.png \
-$(DESTWWW)/missing.png
+$(DESTWWW)/missing.png \
+$(DESTWWW)/noimage.png
 
 DESTLINK = $(DESTWWW)/index.php
Index: /trunk/ippMonitor/raw/columns_in_db.php
===================================================================
--- /trunk/ippMonitor/raw/columns_in_db.php	(revision 28687)
+++ /trunk/ippMonitor/raw/columns_in_db.php	(revision 28688)
@@ -131,5 +131,5 @@
   $values = array();
   while ($qry->fetchInto($row)) {
-    # print "[".$row[0]."]<br>\n";
+    // print "[".$row[0]."]<br>\n";
     foreach ($row as $index => $value) {
       if ($index == 0) {
@@ -138,10 +138,11 @@
     }
   }
-  # print count($values)."<br>\n";
+  // print count($values)."<br>\n";
   asort($values);
-  # print count($values)."<br>\n";
+  // print count($values)."<br>\n";
   foreach ($values as $index => $value) {
-    #echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$count." => ".$value."<br>";
-    $line .= "<option value=\"$value\">$count => $value</option>\n";
+    // echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$count." => ".$value."<br>";
+    // $line .= "<option value=\"$value\">$count => $value</option>\n";
+    $line .= "<option value=\"$value\">$value</option>\n";
     $count++;
   }
Index: /trunk/ippMonitor/raw/getimage.php
===================================================================
--- /trunk/ippMonitor/raw/getimage.php	(revision 28687)
+++ /trunk/ippMonitor/raw/getimage.php	(revision 28688)
@@ -36,6 +36,15 @@
 }
 
-# $basename may contain filename@filerule
+// $basename may contain filename@filerule
 $basename = $_GET[name];
+if ($basename == "noimage.noimage") {
+  $file = fopen ("noimage.png", "r");//$MISSING?
+  if ($file && !$debug) {
+    # do I need to use image/jpg? can I modify this to image/png, etc, based on the type?
+	   header ('Content-Type: image/jpg');
+    fpassthru ($file);
+  }
+  exit ();
+}
 $filerule = $_GET[rule];
 $camera   = $_GET[camera];
Index: /trunk/ippMonitor/raw/ipp.css
===================================================================
--- /trunk/ippMonitor/raw/ipp.css	(revision 28687)
+++ /trunk/ippMonitor/raw/ipp.css	(revision 28688)
@@ -5,33 +5,138 @@
  */
 
-body  { bgcolor: #a0d0e0; background-color: #a0d0e0; padding: 5px; margin: 5px }
-
-a:link, a:visited, a:active { text-decoration: underline; font-weight: bold; color: #ff0000 }
-
-a.button      { text-decoration: none; font-weight: bold;   color: #000000; background: #0080c0}
-a.menutop     { text-decoration: none; font-weight: bold;   color: #ffffff}
-a.menutops    { text-decoration: none; font-weight: bold;   color: #80f0ff}
-a.menuext     { text-decoration: none; font-weight: bold;   color: #ffffff}
-a.menulink    { text-decoration: none; font-weight: normal; color: #000000}
-a.menuselect  { text-decoration: none; font-weight: normal; color: #0000ff}
-a.piclink     { text-decoration: none; font-weight: normal; color: #0080c0}
-
-td.menutop    { text-align: left; background: #0080c0; font-size: small; color: #ffffff; padding: 2px; }
-td.menutops   { text-align: left; background: #0080c0; font-size: small; color: #000000; padding: 2px; }
-td.menuext    { text-align: left; background: #303070; font-size: small; color: #ffffff; padding: 2px; }
-td.menulink   { text-align: left; background: #d0d0ff; font-size: small; color: #000000; padding: 2px; font-weight: normal; text-indent: 0px; }
-td.menuselect { text-align: left; background: #d0d0ff; font-size: small; color: #ff0000; padding: 2px; font-weight: normal; text-indent: 0px; }
-td.menuline   { text-align: left; background: #d0d0ff; font-size: small; color: #000000; padding: 2px; font-weight: normal; text-indent: 0px; }
-
-td.picture    { text-align: left; background: #00ffff; font-size: small; color: #ff0000; padding: 0px; text-indent: 2px; font-weight: normal; }
-td.piclink    { text-align: left; background: #0080c0; font-size: small; color: #ff0000; padding: 0px; text-indent: 0px; font-weight: normal; }
-
-table.page { border: 0px solid #0080c0; background: #a0d0e0; padding: 0px}
-
-td.title { background-color: #ff0000; padding: 5px; font-size: x-large; text-align: left; vertical-align: top}
+body  { 
+    background-color: #a0d0e0; 
+    padding: 5px; 
+    margin: 5px
+}
+
+a:link, a:visited, a:active { 
+    text-decoration: underline; 
+    font-weight: bold; 
+    color: #ff0000
+}
+
+a.button      { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #000000; 
+    background: #0080c0
+}
+a.menutop     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #ffffff
+}
+a.menutops    { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #80f0ff
+}
+a.menuext     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #ffffff
+}
+a.menulink    { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #000000
+}
+a.menuselect  { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #0000ff
+}
+a.piclink     { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #0080c0
+}
+
+td.menutop    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ffffff; 
+    padding: 2px; 
+}
+td.menutops   { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+}
+td.menuext    { 
+    text-align: left; 
+    background: #303070; 
+    font-size: small; 
+    color: #ffffff; 
+    padding: 2px; 
+}
+td.menulink   { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+td.menuselect { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+td.menuline   { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+
+td.picture    { 
+    text-align: left; 
+    background: #00ffff; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 0px; 
+    text-indent: 2px; 
+    font-weight: normal; 
+}
+td.piclink    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 0px; 
+    text-indent: 0px; 
+    font-weight: normal; 
+}
+
+table.page { 
+    border: 0px solid #0080c0; 
+    background: #a0d0e0; 
+    padding: 0px
+}
+
+td.title { 
+    background-color: #ff0000; 
+    padding: 5px; 
+    font-size: x-large; 
+    text-align: left; 
+    vertical-align: top
+}
 
 td.body  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -42,35 +147,37 @@
 }
 
-table.menu { text-align: left; 
-             font-size: small; 
-	     font-weight: normal; 
-	     background: #ff0000; 
-	     border: 3px solid #0080c0; 
-	     padding: 0px; 
-}
-
-table.select { text-align: left; 
-             font-size: small; 
-	     font-weight: normal; 
-	     background: #0080c0; 
-	     border: 1px solid #0080c0; 
-	     padding: 0px; 
+table.menu { 
+    text-align: left; 
+    font-size: small; 
+    font-weight: normal; 
+    background: #ff0000; 
+    border: 3px solid #0080c0; 
+    padding: 0px; 
+}
+
+table.select { 
+    text-align: left; 
+    font-size: small; 
+    font-weight: normal; 
+    background: #0080c0; 
+    border: 1px solid #0080c0; 
+    padding: 0px; 
 }
 
 td.select  { 
-           text-align: left; 
-           font-size: normal;  
-           font-weight: bold;  
-           vertical-align: top;
-	   color: #ffffff; 
-	   background: #0080c0; 
-	   background-color: #0080c0; 
-	   border: 2px solid #0080c0; 
-	   padding: 2px; 
+    text-align: left; 
+    font-size: small;  
+    font-weight: bold;  
+    vertical-align: top;
+    color: #ffffff; 
+    background: #0080c0; 
+    background-color: #0080c0; 
+    border: 2px solid #0080c0; 
+    padding: 2px; 
 }
 
 th.select  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: bold;  
            vertical-align: top;
@@ -92,5 +199,5 @@
 td.list  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -103,5 +210,5 @@
 td.list_off  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -114,5 +221,5 @@
 td.list_drop  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -125,5 +232,5 @@
 td.list_run  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -136,5 +243,5 @@
 td.det_off  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -147,5 +254,5 @@
 td.det_drop  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -158,5 +265,5 @@
 td.det_add  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: normal;  
            vertical-align: top;
@@ -169,5 +276,5 @@
 th.list  { 
            text-align: left; 
-           font-size: normal;  
+           font-size: small;  
            font-weight: bold;  
            vertical-align: top;
@@ -178,2 +285,26 @@
 }
 
+td.ul2x2    { 
+    text-align: right; 
+    vertical-align: bottom;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.ur2x2    { 
+    text-align: left; 
+    vertical-align: bottom;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.ll2x2    { 
+    text-align: right; 
+    vertical-align: top;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.lr2x2    { 
+    text-align: left; 
+    vertical-align: top;
+    padding: 0px; 
+    text-indent: 0px; 
+}
Index: /trunk/ippMonitor/raw/ipp.php
===================================================================
--- /trunk/ippMonitor/raw/ipp.php	(revision 28687)
+++ /trunk/ippMonitor/raw/ipp.php	(revision 28688)
@@ -273,7 +273,20 @@
 }
 
+function head ($title) {
+  echo "<head>\n";
+  echo "  <title> $title </title>\n";
+  /* JavaScript code */
+  echo "  <script type=\"text/javascript\">\n";
+  echo "  function changeCell(cellId, newContent){\n";
+  echo "    document.getElementById(cellId).innerHTML=newContent;\n";
+  echo "  }\n";
+  echo "  </script>\n";
+  echo "</head>\n\n";
+}
+
 function menu ($source, $title, $sheet, $append, $project) {
 
-  echo "<html><head><title> $title </title></head>\n\n";
+  echo "<html>\n";
+  head($title);
   echo "<link rel=\"STYLESHEET\" HREF=\"$sheet\">\n";
   echo "<body>\n";
Index: /trunk/ippMonitor/raw/ipp.science.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.science.dat	(revision 28687)
+++ /trunk/ippMonitor/raw/ipp.science.dat	(revision 28688)
@@ -33,4 +33,6 @@
 menulink  | menuselect   | link    | Warp Summary                 | warpSummary.php
 menulink  | menuselect   | link    | Warp Stage Exp               | warpStageExp.php
+menulink  | menuselect   | link    | Warp Processed Exp           | warpProcessedExp.php
+menulink  | menuselect   | link    | Warp Processed Exp w/ Skycell Images | warpProcessedExp_Images.php
 menulink  | menuselect   | link    | Warp Stage Skyfiles          | warpStageSkyfiles.php
 menulink  | menuselect   | link    | Warp Skyfile Inputs          | warpStageSkyfileInputs.php
Index: /trunk/ippMonitor/raw/warpProcessedExp.php
===================================================================
--- /trunk/ippMonitor/raw/warpProcessedExp.php	(revision 28688)
+++ /trunk/ippMonitor/raw/warpProcessedExp.php	(revision 28688)
@@ -0,0 +1,367 @@
+<?php 
+
+include 'ipp.php';
+
+$ID = checkID ();
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
+
+if ($ID['menu']) {
+  $myMenu = $ID['menu'];
+} else {
+  $myMenu = "ipp.science.dat";
+}
+
+menu($myMenu, 'Warp Processed Exposures', 'ipp.css', $ID['link'], $ID['proj']);
+
+echo "<p> Warp Processed Exposures </p>";
+
+// set up the form
+echo "<form action=\"warpProcessedExp.php\" method=\"POST\">\n";
+
+$restricted = 0;
+
+// define restrictiosn to the queries
+// ** TABLE RESTRICTIONS **
+$WHERE = "WHERE warpRun.fake_id = fakeRun.fake_id AND fakeRun.cam_id = camRun.cam_id AND camRun.chip_id = chipRun.chip_id  AND chipRun.exp_id = rawExp.exp_id";
+$WHERE = check_restrict ('rawExp.exp_name', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('warpRun.state', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.label', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.data_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.dist_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.telescope', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.camera', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.ra', $WHERE, 'min', 0.017453);
+$WHERE = check_restrict ('rawExp.ra', $WHERE, 'max', 0.017453);
+$WHERE = check_restrict ('rawExp.decl', $WHERE, 'min', 0.017453);
+$WHERE = check_restrict ('rawExp.decl', $WHERE, 'max', 0.017453);
+$WHERE = check_restrict ('rawExp.object', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.filter', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.comment', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpSummary.path_base', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpSummary.projection_cell', $WHERE, 'string', 1.0);
+$WHERE = check_ordering ('', $WHERE);
+
+if ($restricted == 0) {
+  if ("none" != "none") {
+    $WHERE = "$WHERE none";
+  }
+}
+
+// get the result table count
+if (basic == "basic") {
+  $sql = "SELECT count(*) FROM warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary $WHERE";
+}
+if (basic == "summary") {
+  $sql = "SELECT count(*) FROM (SELECT rawExp.exp_name,rawExp.exp_id,chipRun.chip_id,camRun.cam_id,fakeRun.fake_id,warpRun.warp_id,warpRun.state,warpRun.label,warpRun.data_group,warpRun.dist_group,rawExp.telescope,rawExp.camera,rawExp.dateobs,rawExp.ra,rawExp.decl,rawExp.object,rawExp.filter,rawExp.exp_time,rawExp.airmass,rawExp.bg,rawExp.bg_stdev,rawExp.comment,warpSummary.path_base,warpSummary.projection_cell FROM warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary $WHERE) as TEMP";
+}
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n";
+  echo "<br><small><b> count query : $sql </b></small><br>\n";
+  menu_end();
+}
+if (!$qry->fetchInto($row)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n";
+  echo "<br><small><b> count query : $sql </b></small><br>\n";
+  menu_end();
+}
+// set up the row counter variables
+if ($ID['from']) {
+  $rowStart = $ID['from'];
+} else {
+  $rowStart = 0;
+}
+$rowLast = $rowStart + $dTABLE;
+$rowTotal = $row[0];
+if ($rowLast > $rowTotal) { $rowLast = $rowTotal; }
+echo "<b> $rowStart to $rowLast of $rowTotal items</b><br>\n";
+
+// query the database
+if (basic == "basic") {
+  $sql = "SELECT rawExp.exp_name,rawExp.exp_id,chipRun.chip_id,camRun.cam_id,fakeRun.fake_id,warpRun.warp_id,warpRun.state,warpRun.label,warpRun.data_group,warpRun.dist_group,rawExp.telescope,rawExp.camera,rawExp.dateobs,rawExp.ra,rawExp.decl,rawExp.object,rawExp.filter,rawExp.exp_time,rawExp.airmass,rawExp.bg,rawExp.bg_stdev,rawExp.comment,ifnull(warpSummary.path_base,'noimage'),ifnull(warpSummary.projection_cell,'noimage') FROM fakeRun,camRun,chipRun,rawExp,warpRun LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE LIMIT $dTABLE OFFSET $rowStart";
+}
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table</b><br>\n";
+  echo "<br><small><b> table query : $sql </b></small><br>\n";
+  menu_end();
+}
+
+// ** HEAD CODE **
+
+// ** BUTTON RESTRICTIONS **
+$buttonLink = button_restrict_string ('rawExp.exp_name', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_string ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_min ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_max ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_string ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_min ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_max ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_string ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_min ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_max ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_min ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_max ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.state', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.label', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.data_group', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.dist_group', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.telescope', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.camera', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.object', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.filter', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.comment', $buttonLink);
+$buttonLink = button_restrict_string ('warpSummary.path_base', $buttonLink);
+$buttonLink = button_restrict_string ('warpSummary.projection_cell', $buttonLink);
+navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, 'warpProcessedExp.php');
+
+echo "&nbsp; : &nbsp; or enter start row: <input type=\"text\" name=\"from\" size=\"5\" value=\"$rowStart\">\n";
+
+// set up the table
+echo "<table class=list>\n";
+
+// echo "<tr><td></td>\n"; // first field is a label set below for the query rows only
+// ** TABLE HEADER **
+echo "<tr><td></td>\n";
+write_header_cell ("list", "Exp Name");
+write_header_cell ("list", "Exp ID");
+write_header_cell ("list", "Chip ID");
+write_header_cell ("list", "Cam ID");
+write_header_cell ("list", "Fake ID");
+write_header_cell ("list", "Warp ID");
+write_header_cell ("list", "image");
+write_header_cell ("list", "state");
+write_header_cell ("list", "label");
+write_header_cell ("list", "data grp");
+write_header_cell ("list", "dist grp");
+write_header_cell ("list", "Telescope");
+write_header_cell ("list", "Camera");
+write_header_cell ("list", "Date/Time");
+write_header_cell ("list", "RA");
+write_header_cell ("list", "DEC");
+write_header_cell ("list", "Object");
+write_header_cell ("list", "FILTER");
+write_header_cell ("list", "exp_time    ");
+write_header_cell ("list", "airmass     ");
+write_header_cell ("list", "backgnd");
+write_header_cell ("list", "stdev    ");
+write_header_cell ("list", "Comment");
+echo "</tr>\n";
+echo "<tr><td></td>\n";
+write_sort_cell ("list", "rawExp.exp_name", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.exp_id", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "chipRun.chip_id", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "camRun.cam_id", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "fakeRun.fake_id", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "warpRun.warp_id", $buttonLink, $ID, 'warpProcessedExp.php');
+echo "<td></td>\n";
+write_sort_cell ("list", "warpRun.state", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "warpRun.label", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "warpRun.data_group", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "warpRun.dist_group", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.telescope", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.camera", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.dateobs", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.ra * 57.295783", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.decl * 57.295783", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.object", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.filter", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.exp_time", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.airmass", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.bg", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.bg_stdev", $buttonLink, $ID, 'warpProcessedExp.php');
+write_sort_cell ("list", "rawExp.comment", $buttonLink, $ID, 'warpProcessedExp.php');
+echo "</tr>\n";
+// echo "</tr>\n";
+
+// query restriction form
+// echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// ** TABLE QUERY **
+echo "<tr><td>&ge;</td>\n";
+write_query_row ('rawExp.exp_name', 5, 'string');
+write_query_row ('rawExp.exp_id', 5, 'min');
+write_query_row ('chipRun.chip_id', 7, 'min');
+write_query_row ('camRun.cam_id', 7, 'min');
+write_query_row ('fakeRun.fake_id', 7, 'min');
+write_query_row ('warpRun.warp_id', 7, 'min');
+echo "<td> &nbsp; </td>\n";
+write_query_row ('warpRun.state', 7, 'string');
+write_query_row ('warpRun.label', 7, 'string');
+write_query_row ('warpRun.data_group', 7, 'string');
+write_query_row ('warpRun.dist_group', 7, 'string');
+write_query_row ('rawExp.telescope', 10, 'string');
+write_query_row ('rawExp.camera', 10, 'string');
+write_query_row ('rawExp.dateobs', 19, 'min');
+write_query_row ('rawExp.ra', 8, 'min');
+write_query_row ('rawExp.decl', 8, 'min');
+write_query_row ('rawExp.object', 8, 'string');
+write_query_row ('rawExp.filter', 10, 'string');
+write_query_row ('rawExp.exp_time', 5, 'min');
+write_query_row ('rawExp.airmass', 5, 'min');
+write_query_row ('rawExp.bg', 5, 'min');
+write_query_row ('rawExp.bg_stdev', 5, 'min');
+write_query_row ('rawExp.comment', 65, 'string');
+echo "</tr><tr><td>&le;</td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.exp_id', 5, 'max');
+write_query_row ('chipRun.chip_id', 7, 'max');
+write_query_row ('camRun.cam_id', 7, 'max');
+write_query_row ('fakeRun.fake_id', 7, 'max');
+write_query_row ('warpRun.warp_id', 7, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.dateobs', 19, 'max');
+write_query_row ('rawExp.ra', 8, 'max');
+write_query_row ('rawExp.decl', 8, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.exp_time', 5, 'max');
+write_query_row ('rawExp.airmass', 5, 'max');
+write_query_row ('rawExp.bg', 5, 'max');
+write_query_row ('rawExp.bg_stdev', 5, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "</tr>\n";
+// echo "</tr>\n";
+
+// list the results
+while ($qry->fetchInto($row)) {
+  // $link = "warpProcessedExp.php" . "?expID=" . $row[0] . "&" . $ID['link'];
+
+  $class = "list";
+  // ** TD CLASS **
+
+  echo "<tr><td></td>\n";
+  // ** TABLE DATA **
+  write_table_cell ($class, '%s', "", $row[0]);
+  $link = "rawImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&rawImfile.exp_id=$row[1]";
+  write_table_cell ($class, '%d', $link, $row[1]);
+  $link = "chipProcessedImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&chipRun.chip_id=$row[2]";
+  write_table_cell ($class, '%d', $link, $row[2]);
+  $link = "camProcessedExp.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&camRun.cam_id=$row[3]";
+  write_table_cell ($class, '%d', $link, $row[3]);
+  $link = "fakeProcessedImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&fakeRun.fake_id=$row[4]";
+  write_table_cell ($class, '%d', $link, $row[4]);
+  $link = "warpStageExp.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&warpRun.warp_id=$row[5]";
+  write_table_cell ($class, '%d', $link, $row[5]);
+  $link = "getimage.php" . "?menu=ipp.science.dat&" . $ID['link'];
+  $link = $link . "&name=$row[22].$row[23]";
+  $link = $link . "&rule=PPSKYCELL.JPEG1";
+  $link = $link . "&camera=GPC1";
+  $link = $link . "&class_id=NONE";
+  echo "<td class=\"$class\"><a href=\"$link\"> <img src=\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\"> </a></td>\n";
+  write_table_cell ($class, '%s', "", $row[6]);
+  write_table_cell ($class, '%s', "", $row[7]);
+  write_table_cell ($class, '%s', "", $row[8]);
+  write_table_cell ($class, '%s', "", $row[9]);
+  write_table_cell ($class, '%s', "", $row[10]);
+  write_table_cell ($class, '%s', "", $row[11]);
+  write_table_cell ($class, '%T', "", $row[12]);
+  write_table_cell ($class, '%C', "", $row[13] * 57.295783);
+  write_table_cell ($class, '%C', "", $row[14] * 57.295783);
+  write_table_cell ($class, '%s', "", $row[15]);
+  write_table_cell ($class, '%s', "", $row[16]);
+  write_table_cell ($class, '%.2f', "", $row[17]);
+  write_table_cell ($class, '%.4f', "", $row[18]);
+  write_table_cell ($class, '%.2f', "", $row[19]);
+  write_table_cell ($class, '%.2f', "", $row[20]);
+  write_table_cell ($class, '%s', "", $row[21]);
+  echo "</tr>\n";
+}
+
+// query restriction form
+// echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// TABLE QUERY 
+// echo "</tr>\n";
+
+// close the table and form
+echo "</table>\n";
+echo "<input type=\"submit\" name=\"constraints\" value=\"refine search\">\n";
+$pass = $ID['pass'];
+$proj = $ID['proj'];
+$menu = $ID['menu'];
+echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
+echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
+echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
+echo "</form>\n";
+
+// ** TAIL CODE **
+
+echo "<small> WHERE: $WHERE<br><br></small>\n";
+echo "<small> SQL: $sql<br><br></small>\n";
+
+menu_end();
+
+?>
Index: /trunk/ippMonitor/raw/warpProcessedExp_Images.php
===================================================================
--- /trunk/ippMonitor/raw/warpProcessedExp_Images.php	(revision 28688)
+++ /trunk/ippMonitor/raw/warpProcessedExp_Images.php	(revision 28688)
@@ -0,0 +1,462 @@
+<?php 
+
+include 'ipp.php';
+
+$ID = checkID ();
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
+
+if ($ID['menu']) {
+  $myMenu = $ID['menu'];
+} else {
+  $myMenu = "ipp.science.dat";
+}
+
+menu($myMenu, 'Warp Stage Exposures w/ Images', 'ipp.css', $ID['link'], $ID['proj']);
+
+echo "<p> Warp Stage Exposures w/ Images</p>";
+
+// set up the form
+echo "<form action=\"warpProcessedExp_Images.php\" method=\"POST\">\n";
+
+$restricted = 0;
+
+// define restrictiosn to the queries
+// ** TABLE RESTRICTIONS **
+$WHERE = "WHERE warpRun.fake_id = fakeRun.fake_id AND fakeRun.cam_id = camRun.cam_id AND camRun.chip_id = chipRun.chip_id AND chipRun.exp_id = rawExp.exp_id";
+$WHERE = check_restrict ('rawExp.exp_name', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('chipRun.chip_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camRun.cam_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('fakeRun.fake_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('warpRun.warp_id', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('warpRun.state', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.label', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.data_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpRun.dist_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.telescope', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.camera', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.dateobs', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.ra', $WHERE, 'min', 0.017453);
+$WHERE = check_restrict ('rawExp.ra', $WHERE, 'max', 0.017453);
+$WHERE = check_restrict ('rawExp.decl', $WHERE, 'min', 0.017453);
+$WHERE = check_restrict ('rawExp.decl', $WHERE, 'max', 0.017453);
+$WHERE = check_restrict ('rawExp.object', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.filter', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.exp_time', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.airmass', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.bg', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('rawExp.comment', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpSummary.path_base', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('warpSummary.projection_cell', $WHERE, 'string', 1.0);
+$WHERE = check_ordering ('', $WHERE);
+
+if ($restricted == 0) {
+  if ("none" != "none") {
+    $WHERE = "$WHERE none";
+  }
+}
+
+// get the result table count
+if (basic == "basic") {
+  $sql = "SELECT count(*) FROM fakeRun,camRun,chipRun,rawExp,warpRun LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE";
+}
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n";
+  echo "<br><small><b> count query : $sql </b></small><br>\n";
+  menu_end();
+}
+if (!$qry->fetchInto($row)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n";
+  echo "<br><small><b> count query : $sql </b></small><br>\n";
+  menu_end();
+}
+// set up the row counter variables
+if ($ID['from']) {
+  $rowStart = $ID['from'];
+} else {
+  $rowStart = 0;
+}
+$rowLast = $rowStart + $dTABLE;
+$rowTotal = $row[0];
+if ($rowLast > $rowTotal) { $rowLast = $rowTotal; }
+echo "<b> $rowStart to $rowLast of $rowTotal items</b><br>\n";
+
+// query the database
+if (basic == "basic") {
+  $sql = "SELECT rawExp.exp_name,rawExp.exp_id,chipRun.chip_id,camRun.cam_id,fakeRun.fake_id,warpRun.warp_id,warpRun.state,warpRun.label,warpRun.data_group,warpRun.dist_group,rawExp.telescope,rawExp.camera,rawExp.dateobs,rawExp.ra,rawExp.decl,rawExp.object,rawExp.filter,rawExp.exp_time,rawExp.airmass,rawExp.bg,rawExp.bg_stdev,rawExp.comment,ifnull(warpSummary.path_base,'noimage'),ifnull(warpSummary.projection_cell,'noimage') FROM fakeRun,camRun,chipRun,rawExp,warpRun LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE LIMIT $dTABLE OFFSET $rowStart";
+}
+
+/* echo "<tr><td>SQL = $sql</td></tr>\n"; */
+/* menu_end(); */
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table</b><br>\n";
+  echo "<br><small><b> table query : $sql </b></small><br>\n";
+  menu_end();
+}
+
+// ** HEAD CODE **
+
+// ** BUTTON RESTRICTIONS **
+$buttonLink = button_restrict_string ('rawExp.exp_name', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.exp_id', $buttonLink);
+$buttonLink = button_restrict_string ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_min ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_max ('chipRun.chip_id', $buttonLink);
+$buttonLink = button_restrict_string ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_min ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_max ('camRun.cam_id', $buttonLink);
+$buttonLink = button_restrict_string ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_min ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_max ('fakeRun.fake_id', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_min ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_max ('warpRun.warp_id', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.state', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.label', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.data_group', $buttonLink);
+$buttonLink = button_restrict_string ('warpRun.dist_group', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.telescope', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.camera', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.dateobs', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.ra', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.decl', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.object', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.filter', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.exp_time', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.airmass', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.bg', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_min ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_max ('rawExp.bg_stdev', $buttonLink);
+$buttonLink = button_restrict_string ('rawExp.comment', $buttonLink);
+$buttonLink = button_restrict_string ('warpSummary.path_base', $buttonLink);
+$buttonLink = button_restrict_string ('warpSummary.projection_cell', $buttonLink);
+navigate_buttons ($rowStart, $rowLast, $dTABLE, 
+		  $rowTotal, $buttonLink, $ID, 'warpProcessedExp_Images.php');
+
+echo "&nbsp; : &nbsp; or enter start row: <input type=\"text\" name=\"from\" size=\"5\" value=\"$rowStart\">\n";
+
+// set up the table
+echo "<table class=list>\n";
+
+// echo "<tr><td></td>\n"; // first field is a label set below for the query rows only
+// ** TABLE HEADER **
+echo "<tr><td></td>\n";
+write_header_cell ("list", "Exp Name");
+write_header_cell ("list", "Exp ID");
+write_header_cell ("list", "Chip ID");
+write_header_cell ("list", "Cam ID");
+write_header_cell ("list", "Fake ID");
+write_header_cell ("list", "Warp ID");
+write_header_cell ("list", "image");
+write_header_cell ("list", "image");
+write_header_cell ("list", "state");
+write_header_cell ("list", "label");
+write_header_cell ("list", "data grp");
+write_header_cell ("list", "dist grp");
+write_header_cell ("list", "Telescope");
+write_header_cell ("list", "Camera");
+write_header_cell ("list", "Date/Time");
+write_header_cell ("list", "RA");
+write_header_cell ("list", "DEC");
+write_header_cell ("list", "Object");
+write_header_cell ("list", "FILTER");
+write_header_cell ("list", "exp_time    ");
+write_header_cell ("list", "airmass     ");
+write_header_cell ("list", "backgnd");
+write_header_cell ("list", "stdev    ");
+write_header_cell ("list", "Comment");
+echo "</tr>\n";
+echo "<tr><td></td>\n";
+write_sort_cell ("list", "rawExp.exp_name", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.exp_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "chipRun.chip_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "camRun.cam_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "fakeRun.fake_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "warpRun.warp_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+echo "<td></td>\n";
+echo "<td></td>\n";
+write_sort_cell ("list", "warpRun.state", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "warpRun.label", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "warpRun.data_group", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "warpRun.dist_group", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.telescope", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.camera", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.dateobs", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.ra * 57.295783", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.decl * 57.295783", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.object", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.filter", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.exp_time", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.airmass", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.bg", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.bg_stdev", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+write_sort_cell ("list", "rawExp.comment", $buttonLink, $ID, 'warpProcessedExp_Images.php');
+echo "</tr>\n";
+// echo "</tr>\n";
+
+// query restriction form
+// echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// ** TABLE QUERY **
+echo "<tr><td>&ge;</td>\n";
+write_query_row ('rawExp.exp_name', 5, 'string');
+write_query_row ('rawExp.exp_id', 5, 'min');
+write_query_row ('chipRun.chip_id', 7, 'min');
+write_query_row ('camRun.cam_id', 7, 'min');
+write_query_row ('fakeRun.fake_id', 7, 'min');
+write_query_row ('warpRun.warp_id', 7, 'min');
+echo "<td> &nbsp; </td>\n";
+echo "<td></td>\n";
+write_query_row ('warpRun.state', 7, 'string');
+write_query_row ('warpRun.label', 7, 'string');
+write_query_row ('warpRun.data_group', 7, 'string');
+write_query_row ('warpRun.dist_group', 7, 'string');
+write_query_row ('rawExp.telescope', 10, 'string');
+write_query_row ('rawExp.camera', 10, 'string');
+write_query_row ('rawExp.dateobs', 19, 'min');
+write_query_row ('rawExp.ra', 8, 'min');
+write_query_row ('rawExp.decl', 8, 'min');
+write_query_row ('rawExp.object', 8, 'string');
+write_query_row ('rawExp.filter', 10, 'string');
+write_query_row ('rawExp.exp_time', 5, 'min');
+write_query_row ('rawExp.airmass', 5, 'min');
+write_query_row ('rawExp.bg', 5, 'min');
+write_query_row ('rawExp.bg_stdev', 5, 'min');
+write_query_row ('rawExp.comment', 65, 'string');
+echo "</tr><tr><td>&le;</td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.exp_id', 5, 'max');
+write_query_row ('chipRun.chip_id', 7, 'max');
+write_query_row ('camRun.cam_id', 7, 'max');
+write_query_row ('fakeRun.fake_id', 7, 'max');
+write_query_row ('warpRun.warp_id', 7, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.dateobs', 19, 'max');
+write_query_row ('rawExp.ra', 8, 'max');
+write_query_row ('rawExp.decl', 8, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.exp_time', 5, 'max');
+write_query_row ('rawExp.airmass', 5, 'max');
+write_query_row ('rawExp.bg', 5, 'max');
+write_query_row ('rawExp.bg_stdev', 5, 'max');
+echo "<td> &nbsp; </td>\n";
+echo "</tr>\n";
+// echo "</tr>\n";
+
+/* $warpIdCollection[$warpId]["00"] = "ul"; */
+/* $warpIdCollection[$warpId]["01"] = "ur"; */
+/* $warpIdCollection[$warpId]["10"] = "ll"; */
+/* $warpIdCollection[$warpId]["11"] = "lr"; */
+$warpIdCollection = array();
+
+$noImageValue = "<a href=\"noimage.png\"><img src=\"noimage.png\"></a>";
+
+// list the results
+while ($qry->fetchInto($row)) {
+  // $link = "warpProcessedExp_Images.php" . "?expID=" . $row[0] . "&" . $ID['link'];
+
+  $class = "list";
+  // ** TD CLASS **
+
+  //Identify current warpId
+  $warpId = $row[5];
+/*   echo "<tr><td>Number of elements in warpIdCollection: ".count($warpIdCollection)."</td></tr>\n"; */
+/*   echo "<tr><td>(warpId=$warpId)</td></tr>\n"; */
+
+  if (!isSet($warpIdCollection[$warpId])) {
+/*     echo "<tr><td>$warpId not in warpIdCollection</td></tr>"; */
+    $warpIdCollection[$warpId] = array();
+    $skyCellValue = preg_replace("|skycell[.]|","",$row[23]);
+    $warpIdCollection[$warpId]["11"] = $skyCellValue;
+/*     echo "<tr><td>Skycell is [$skyCellValue]</td></tr>"; */
+
+    echo "<tr>\n";
+    // ** TABLE DATA **
+    echo "<td></td>\n";
+    write_table_cell ($class, '%s', "", $row[0]);
+    $link = "rawImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&rawImfile.exp_id=$row[1]";
+    write_table_cell ($class, '%d', $link, $row[1]);
+    $link = "chipProcessedImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&chipRun.chip_id=$row[2]";
+    write_table_cell ($class, '%d', $link, $row[2]);
+    $link = "camProcessedExp.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&camRun.cam_id=$row[3]";
+    write_table_cell ($class, '%d', $link, $row[3]);
+    $link = "fakeProcessedImfile.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&fakeRun.fake_id=$row[4]";
+    write_table_cell ($class, '%d', $link, $row[4]);
+    $link = "warpStageExp.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&warpRun.warp_id=$row[5]";
+    write_table_cell ($class, '%d', $link, $row[5]);
+    /* Image */
+    echo "<td class=\"$class\">\n";
+    echo "<table border=\"1\"><tr>\n";
+    echo "  <td class=\"ul2x2\" id=\"$warpId.00\">$noImageValue</td>\n";
+    echo "  <td class=\"ur2x2\" id=\"$warpId.01\">$noImageValue</td>\n";
+    echo "</tr><tr>\n";
+    echo "  <td class=\"ll2x2\" id=\"$warpId.10\">$noImageValue</td>\n";
+    echo "  <td class=\"lr2x2\" id=\"$warpId.11\">$noImageValue</td></tr></table>\n";
+    echo "</td>\n";
+    $link = "getimage.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&name=$row[22].$row[23]";
+    $link = $link . "&rule=PPSKYCELL.JPEG1";
+    $link = $link . "&camera=GPC1";
+    $link = $link . "&class_id=NONE";
+
+    /* Image as Text */
+    echo "<td class=\"$class\">\n";
+    echo "<table border=\"1\"><tr>\n";
+    echo "  <td class=\"ul2x2\" id=\"t$warpId.00\">No image</td>\n";
+    echo "  <td class=\"ur2x2\" id=\"t$warpId.01\">No image</td>\n";
+    echo "</tr><tr>\n";
+    echo "  <td class=\"ll2x2\" id=\"t$warpId.10\">No image</td>\n";
+    echo "  <td class=\"lr2x2\" id=\"t$warpId.11\">No image</td></tr></table>\n";
+    echo "</td>\n";
+
+    $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
+    echo "<script type=\"text/javascript\">changeCell(\"$warpId.11\", \"$cellContent\");</script>";
+    $imageNameValue = ($row[23]=="noimage" ?
+		       "No image" : $row[23]);
+    echo "<script type=\"text/javascript\">changeCell(\"t$warpId.11\", \"$imageNameValue\");</script>";
+
+    //resume with "regular" columns
+    write_table_cell ($class, '%s', "", $row[6]);
+    write_table_cell ($class, '%s', "", $row[7]);
+    write_table_cell ($class, '%s', "", $row[8]);
+    write_table_cell ($class, '%s', "", $row[9]);
+    write_table_cell ($class, '%s', "", $row[10]);
+    write_table_cell ($class, '%s', "", $row[11]);
+    write_table_cell ($class, '%T', "", $row[12]);
+    write_table_cell ($class, '%C', "", $row[13] * 57.295783);
+    write_table_cell ($class, '%C', "", $row[14] * 57.295783);
+    write_table_cell ($class, '%s', "", $row[15]);
+    write_table_cell ($class, '%s', "", $row[16]);
+    write_table_cell ($class, '%.2f', "", $row[17]);
+    write_table_cell ($class, '%.4f', "", $row[18]);
+    write_table_cell ($class, '%.2f', "", $row[19]);
+    write_table_cell ($class, '%.2f', "", $row[20]);
+    write_table_cell ($class, '%s', "", $row[21]);
+    echo "</tr>\n";
+
+  } else {
+    // Update table cell content
+/*     echo "<tr><td>$warpId in warpIdCollection</td></tr>"; */
+    $lrValue =  $warpIdCollection[$warpId]["11"];
+    $skyCellValue = preg_replace("|skycell[.]|","",$row[23]);
+/*     echo "<tr><td>Current skycell is [$skyCellValue] / LowerRight is [$lrValue]</td></tr>"; */
+
+    $link = "getimage.php" . "?menu=ipp.science.dat&" . $ID['link'];
+    $link = $link . "&name=$row[22].$row[23]";
+    $link = $link . "&rule=PPSKYCELL.JPEG1";
+    $link = $link . "&camera=GPC1";
+    $link = $link . "&class_id=NONE";
+    $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
+
+    if ($skyCellValue == $lrValue + 1) {
+/*       echo "<tr><td>Update LowerLeft</td></tr>"; */
+      $warpIdCollection[$warpId]["10"] = $skyCellValue;
+      echo "<script type=\"text/javascript\">changeCell(\"$warpId.10\", \"$cellContent\");</script>";
+      echo "<script type=\"text/javascript\">changeCell(\"t$warpId.10\", \"$row[23]\");</script>";
+    } else {
+      if (!isSet($warpIdCollection[$warpId]["01"])) {
+/* 	echo "<tr><td>Update UpperRight</td></tr>"; */
+	$warpIdCollection[$warpId]["01"] = $skyCellValue;
+	echo "<script type=\"text/javascript\">changeCell(\"$warpId.01\", \"$cellContent\");</script>";
+	echo "<script type=\"text/javascript\">changeCell(\"t$warpId.01\", \"$row[23]\");</script>";
+      } else {
+	$urValue = $warpIdCollection[$warpId]["01"];
+	$warpIdCollection[$warpId]["00"] = $skyCellValue;
+	if ($urValue + 1 != $skyCellValue) {
+	  $expected = $urValue + 1;
+	  $actual = $skyCellValue;
+	  echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"Problem in UpperLeft corner: expected $expected but was $actual\");</script>";
+	  echo "<tr><td>Problem in UpperLeft!</td></tr>";
+	} else {
+/* 	  echo "<tr><td>Update UpperLeft</td></tr>"; */
+	  echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"$cellContent\");</script>";
+	  echo "<script type=\"text/javascript\">changeCell(\"t$warpId.00\", \"$row[23]\");</script>";
+	}
+      }
+    }
+  }
+
+
+}
+
+// query restriction form
+// echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// TABLE QUERY 
+// echo "</tr>\n";
+
+// close the table and form
+echo "</table>\n";
+echo "<input type=\"submit\" name=\"constraints\" value=\"refine search\">\n";
+$pass = $ID['pass'];
+$proj = $ID['proj'];
+$menu = $ID['menu'];
+echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
+echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
+echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
+echo "</form>\n";
+
+// ** TAIL CODE **
+
+echo "<small> WHERE: $WHERE<br><br></small>\n";
+echo "<small> SQL: $sql<br><br></small>\n";
+
+menu_end();
+
+?>
