Index: trunk/ippMonitor/def/camPendingExp.d
===================================================================
--- trunk/ippMonitor/def/camPendingExp.d	(revision 18722)
+++ trunk/ippMonitor/def/camPendingExp.d	(revision 18970)
@@ -14,8 +14,9 @@
 
 #     field                     size  format  name          show   link to                  extras
-FIELD chipRun.exp_id,	         5,   %s,     exposure ID,  value, chipProcessedImfile.php, ARG1
+FIELD chipRun.exp_id,	         5,   %s,     Exp ID,       value, chipProcessedImfile.php, ARG1
 FIELD rawExp.exp_name,     	 5,   %s,     Exp Name,     value, rawImfile.php,  ARG1
 FIELD chipRun.chip_id,           5,   %s,     chip ID,      value, chipProcessedExp.php,    ARG1
 FIELD camRun.cam_id,             5,   %s,     cam ID
+FIELD camRun.state,              5,   %s,     state
 FIELD rawExp.telescope,      	10,   %s,     Telescope
 FIELD rawExp.camera,         	10,   %s,     Camera
@@ -29,4 +30,5 @@
 FIELD rawExp.bg,             	 5,   %.2f,   backgnd
 FIELD rawExp.bg_stdev,       	 5,   %.2f,   stdev    
-FIELD rawExp.bg_mean_stdev,  	 5,   %.2f,   &lt;backgnd&gt;
-FIELD rawExp.sat_pixel_frac, 	 5,   %.3f,   f(sat pixels)
+FIELD rawExp.comment,  	        65,   %s,     Comment
+
+# FIELD rawExp.bg_mean_stdev,  	 5,   %.2f,   &lt;backgnd&gt;
Index: trunk/ippMonitor/def/camProcessedExp.d
===================================================================
--- trunk/ippMonitor/def/camProcessedExp.d	(revision 18722)
+++ trunk/ippMonitor/def/camProcessedExp.d	(revision 18970)
@@ -9,4 +9,5 @@
 WHERE chipRun.exp_id = rawExp.exp_id
 WHERE camProcessedExp.cam_id  = camRun.cam_id
+WHERE camProcessedExp.fault = 0
 
 # define image names to be used below
@@ -40,14 +41,16 @@
 FIELD rawExp.exp_time,       		 5,   %.2f,     exp_time    
 FIELD rawExp.airmass,        		 5,   %.4f,     airmass     
-FIELD camRun.reduction,       	         5,   %s,     reduction
 FIELD camProcessedExp.bg,             	 5,   %.2f,     backgnd
 FIELD camProcessedExp.bg_stdev,       	 5,   %.2f,     stdev    
-FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
 FIELD camProcessedExp.n_stars,  	 5,   %d,     Nstars
 FIELD camProcessedExp.n_astrom, 	 5,   %d,     Nastrom
 FIELD camProcessedExp.sigma_ra, 	 5,   %f,     sigma ra
 FIELD camProcessedExp.fwhm_major,     	 5,   %f,     FHWM (major)
+FIELD rawExp.comment,  	                65, %s,     Comment
+
 FIELD camProcessedExp.path_base,     	 5,   %s,     path_base,    none
 FIELD rawExp.exp_id,     		 5,   %s,     Exp ID,       none
 
 # the last two are used as arguments elsewhere, thus needed in the list, even if not displayed
+# FIELD camRun.reduction,       	         5,   %s,     reduction
+# FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
Index: trunk/ippMonitor/def/camProcessedExp_NoImages.d
===================================================================
--- trunk/ippMonitor/def/camProcessedExp_NoImages.d	(revision 18722)
+++ trunk/ippMonitor/def/camProcessedExp_NoImages.d	(revision 18970)
@@ -31,21 +31,24 @@
 FIELD chipRun.chip_id,          	 5,   %d,     chip ID
 FIELD camRun.cam_id,            	 5,   %d,     cam ID,       value, 	 chipProcessedExp.php,    ARG1
+FIELD camRun.state,                      5,   %s,     state
 FIELD rawExp.telescope,      		10,   %s,     Telescope
 FIELD rawExp.camera,         		10,   %s,     Camera
 FIELD rawExp.dateobs,        		19,   %T,     Date/Time
-FIELD rawExp.filter,         		10,   %s,     FILTER
 FIELD rawExp.ra,           		 8,   %10.6f, RA,           op=OP1      
 FIELD rawExp.decl,         		 8,   %10.6f, DEC,          op=OP2
 FIELD rawExp.object,         		10,   %s,     Object
+FIELD rawExp.filter,         		10,   %s,     FILTER
 FIELD rawExp.exp_time,       		 5,   %.2f,     exp_time    
 FIELD rawExp.airmass,        		 5,   %.4f,     airmass     
-FIELD camRun.reduction,       	         5,   %s,     reduction
 FIELD camProcessedExp.bg,             	 5,   %.2f,     backgnd
 FIELD camProcessedExp.bg_stdev,       	 5,   %.2f,     stdev    
-FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
 FIELD camProcessedExp.n_stars,  	 5,   %d,     Nstars
 FIELD camProcessedExp.n_astrom, 	 5,   %d,     Nastrom
 FIELD camProcessedExp.sigma_ra, 	 5,   %f,     sigma ra
 FIELD camProcessedExp.fwhm_major,     	 5,   %f,     FHWM (major)
+FIELD rawExp.comment,  	                65, %s,     Comment
+
 FIELD camProcessedExp.path_base,     	 5,   %s,     path_base,    none
 FIELD rawExp.exp_id,     		 5,   %s,     Exp ID,       none
+
+# FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
Index: trunk/ippMonitor/def/camProcessedExp_failure.d
===================================================================
--- trunk/ippMonitor/def/camProcessedExp_failure.d	(revision 18722)
+++ trunk/ippMonitor/def/camProcessedExp_failure.d	(revision 18970)
@@ -1,4 +1,4 @@
 TABLE camRun, camProcessedExp, chipRun, rawExp
-TITLE Camera Processed (No Images)
+TITLE Camera Failed Exposures
 FILE  camProcessedExp_failure.php
 MENU  ipp.science.dat
@@ -31,23 +31,27 @@
 FIELD chipRun.chip_id,          	 5,   %d,     chip ID,      value, 	 chipProcessedExp.php,        ARG1
 FIELD camRun.cam_id,            	 5,   %d,     cam ID,       value,       camProcessedExp_failure.php, ARG2
+FIELD camRun.state,                      5,   %s,     state
 FIELD rawExp.telescope,      		10,   %s,     Telescope
 FIELD rawExp.camera,         		10,   %s,     Camera
 FIELD rawExp.dateobs,        		19,   %T,     Date/Time
-FIELD rawExp.filter,         		10,   %s,     FILTER
 FIELD rawExp.ra,           		 8,   %10.6f, RA,           op=OP1      
 FIELD rawExp.decl,         		 8,   %10.6f, DEC,          op=OP2
 FIELD rawExp.object,         		10,   %s,     Object
+FIELD rawExp.filter,         		10,   %s,     FILTER
 FIELD rawExp.exp_time,       		 5,   %.2f,     exp_time    
 FIELD rawExp.airmass,        		 5,   %.4f,     airmass     
-FIELD camRun.reduction,       	         5,   %s,     reduction
 FIELD camProcessedExp.bg,             	 5,   %.2f,     backgnd
 FIELD camProcessedExp.bg_stdev,       	 5,   %.2f,     stdev    
-FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
 FIELD camProcessedExp.n_stars,  	 5,   %d,     Nstars
 FIELD camProcessedExp.n_astrom, 	 5,   %d,     Nastrom
 FIELD camProcessedExp.sigma_ra, 	 5,   %f,     sigma ra
 FIELD camProcessedExp.fwhm_major,     	 5,   %f,     FHWM (major)
+FIELD rawExp.comment,  	                65, %s,     Comment
+
 FIELD camProcessedExp.path_base,     	 5,   %s,     path_base,    none
 FIELD rawExp.exp_id,     		 5,   %s,     Exp ID,       none
 
+# FIELD camRun.reduction,       	         5,   %s,     reduction
+# FIELD camProcessedExp.bg_mean_stdev,  	 5,   %.2f,     &lt;backgnd&gt;
+
 TAIL PHP insert_log ('LOG.IMFILE');
Index: trunk/ippMonitor/def/camStageExp.d
===================================================================
--- trunk/ippMonitor/def/camStageExp.d	(revision 18722)
+++ trunk/ippMonitor/def/camStageExp.d	(revision 18970)
@@ -1,5 +1,5 @@
 TABLE camRun, chipRun, rawExp
-TITLE Camera Pending
-FILE  camPendingExp.php
+TITLE Camera Stage Exposures
+FILE  camStageExp.php
 MENU  ipp.science.dat
 
@@ -12,6 +12,7 @@
 OP   OP2  $rawExp.decl * 57.295783
 
+
 #     field                     size  format  name          show   link to                  extras
-FIELD chipRun.exp_id,	         5,   %s,     exposure ID,  value, chipProcessedImfile.php, ARG1
+FIELD chipRun.exp_id,	         5,   %s,     Exp ID,       value, chipProcessedImfile.php, ARG1
 FIELD rawExp.exp_name,     	 5,   %s,     Exp Name,     value, rawImfile.php,  ARG1
 FIELD chipRun.chip_id,           5,   %s,     chip ID,      value, chipProcessedExp.php,    ARG1
@@ -29,4 +30,5 @@
 FIELD rawExp.bg,             	 5,   %.2f,   backgnd
 FIELD rawExp.bg_stdev,       	 5,   %.2f,   stdev    
-FIELD rawExp.bg_mean_stdev,  	 5,   %.2f,   &lt;backgnd&gt;
-FIELD rawExp.sat_pixel_frac, 	 5,   %.3f,   f(sat pixels)
+FIELD rawExp.comment,  	        65,   %s,     Comment
+
+# FIELD rawExp.bg_mean_stdev,  	 5,   %.2f,   &lt;backgnd&gt;
Index: trunk/ippMonitor/def/chipPendingExp.d
===================================================================
--- trunk/ippMonitor/def/chipPendingExp.d	(revision 18722)
+++ trunk/ippMonitor/def/chipPendingExp.d	(revision 18970)
@@ -21,6 +21,6 @@
 FIELD rawExp.camera,         	10, %s,     Camera
 FIELD rawExp.dateobs,        	19, %T,     Date/Time
-FIELD rawExp.ra,       	         5, %10.6f, RA,          op=OP1    
-FIELD rawExp.decl,       	 5, %10.6f, DEC,         op=OP2
+FIELD rawExp.ra,       	         8, %10.6f, RA,          op=OP1    
+FIELD rawExp.decl,       	 8, %10.6f, DEC,         op=OP2
 FIELD rawExp.object,         	 8, %s,     Object
 FIELD rawExp.filter,         	10, %s,     FILTER
Index: trunk/ippMonitor/def/chipPendingImfile.d
===================================================================
--- trunk/ippMonitor/def/chipPendingImfile.d	(revision 18722)
+++ trunk/ippMonitor/def/chipPendingImfile.d	(revision 18970)
@@ -21,5 +21,5 @@
 FIELD chipRun.exp_id,     	 5, %d,     Exp ID
 FIELD rawExp.exp_name,     	 5, %s,     Exp Name,    value,  rawImfile.php,  ARG1
-FIELD rawImfile.class_id,     	 5, %s,     Class ID
+FIELD rawImfile.class_id,     	 8, %s,     Class ID
 FIELD chipRun.chip_id,    	 7, %d,     chip ID
 FIELD chipRun.state,    	 7, %s,     state
@@ -27,6 +27,6 @@
 FIELD rawExp.camera,         	10, %s,     Camera
 FIELD rawExp.dateobs,        	19, %T,     Date/Time
-FIELD rawExp.ra,       	         5, %10.6f, RA,          op=OP1    
-FIELD rawExp.decl,       	 5, %10.6f, DEC,         op=OP2
+FIELD rawExp.ra,       	         8, %10.6f, RA,          op=OP1    
+FIELD rawExp.decl,       	 8, %10.6f, DEC,         op=OP2
 FIELD rawExp.object,         	 8, %s,     Object
 FIELD rawExp.filter,         	10, %s,     FILTER
@@ -35,3 +35,5 @@
 FIELD rawExp.bg,             	 5, %.2f,   backgnd
 FIELD rawExp.bg_stdev,       	 5, %.2f,   stdev    
+FIELD *,                         5, %d,     Nstars,      value=0
+FIELD *, 	                 5, %.2f,   FHWM,        value=0.0
 FIELD rawExp.comment,  	        65, %s,     Comment
Index: trunk/ippMonitor/def/chipProcessedImfile.d
===================================================================
--- trunk/ippMonitor/def/chipProcessedImfile.d	(revision 18722)
+++ trunk/ippMonitor/def/chipProcessedImfile.d	(revision 18970)
@@ -23,5 +23,5 @@
 FIELD chipRun.exp_id,         	   	  5, %d,     Exp ID,      value,  rawImfile.php,           ARG1
 FIELD rawExp.exp_name,     	   	  5, %s,     Exp Name,    value,  chipProcessedImfile.php, ARG2
-FIELD chipProcessedImfile.class_id,	  5, %s,     Class ID
+FIELD chipProcessedImfile.class_id,	  8, %s,     Class ID
 FIELD chipRun.chip_id,        	   	  7, %d,     chip ID
 FIELD chipRun.state,        	   	  7, %s,     state
@@ -33,11 +33,12 @@
 FIELD rawExp.object,       	   	  8, %s,     Object
 FIELD rawExp.filter,         	   	 10, %s,     FILTER
-FIELD rawExp.exp_time,       	   	  5, %.2f,     exp_time    
-FIELD rawExp.airmass,        	   	  5, %.4f,     airmass     
-FIELD chipProcessedImfile.bg,             5, %.2f,     backgnd
-FIELD chipProcessedImfile.bg_stdev,       5, %.2f,     stdev    
+FIELD rawExp.exp_time,       	   	  5, %.2f,   exp_time    
+FIELD rawExp.airmass,        	   	  5, %.4f,   airmass     
+FIELD chipProcessedImfile.bg,             5, %.2f,   backgnd
+FIELD chipProcessedImfile.bg_stdev,       5, %.2f,   stdev    
 FIELD chipProcessedImfile.n_stars,  	  5, %d,     Nstars
-FIELD chipProcessedImfile.fwhm_major, 	  5, %f,     FHWM
+FIELD chipProcessedImfile.fwhm_major, 	  5, %.2f,   FHWM
 FIELD chipProcessedImfile.path_base,      5, %s,     path_base, none
+FIELD rawExp.comment,  	                 65, %s,     Comment
 
 TAIL PHP insert_log ('LOG.IMFILE');
Index: trunk/ippMonitor/def/chipProcessedImfile_failure.d
===================================================================
--- trunk/ippMonitor/def/chipProcessedImfile_failure.d	(revision 18722)
+++ trunk/ippMonitor/def/chipProcessedImfile_failure.d	(revision 18970)
@@ -24,5 +24,5 @@
 FIELD chipRun.exp_id,         	   	  5, %d,     Exp ID,      value,  rawImfile.php,           ARG1
 FIELD rawExp.exp_name,     	   	  5, %s,     Exp Name,    value,  chipProcessedImfile_failure.php, ARG2
-FIELD chipProcessedImfile.class_id,	  5, %s,     Class ID
+FIELD chipProcessedImfile.class_id,	  8, %s,     Class ID
 FIELD chipRun.chip_id,        	   	  7, %d,     chip ID
 FIELD chipRun.state,        	   	  7, %s,     state
@@ -39,6 +39,7 @@
 FIELD chipProcessedImfile.bg_stdev,       5, %.2f,   stdev    
 FIELD chipProcessedImfile.n_stars,  	  5, %d,     Nstars
-FIELD chipProcessedImfile.fwhm_major, 	  5, %f,     FHWM
+FIELD chipProcessedImfile.fwhm_major, 	  5, %.2f,   FHWM
 FIELD chipProcessedImfile.path_base,      5, %s,     path_base, none
+FIELD rawExp.comment,  	                 65, %s,     Comment
 
 TAIL PHP insert_log ('LOG.IMFILE');
Index: trunk/ippMonitor/raw/ipp.php
===================================================================
--- trunk/ippMonitor/raw/ipp.php	(revision 18722)
+++ trunk/ippMonitor/raw/ipp.php	(revision 18970)
@@ -310,13 +310,23 @@
   // add a sort key?
   $sortKey = "";
-  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
-    $sortKey = "&sort=" . $_GET['sort']; 
-  } else {
-    $sortKey = "&sort=" . $_POST['sort'];
-  }
-  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
-    $sortKey = "&rsort=" . $_GET['rsort']; 
-  } else {
-    $sortKey = "&rsort=" . $_POST['rsort'];
+  // try sort forward
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $sortVal = $_GET['sort']; 
+  } else {
+    $sortVal = $_POST['sort'];
+  }
+  if ($sortVal != "") {
+    $sortKey = "&sort=" . $sortVal;
+  }
+  // try sort reverse
+  if ($sortKey == "") {
+    if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+      $sortKey = $_GET['rsort']; 
+    } else {
+      $sortKey = $_POST['rsort'];
+    }
+    if ($sortVal != "") {
+      $sortKey = "&rsort=" . $sortVal;
+    }
   }
 
@@ -502,25 +512,33 @@
 
   if ($_SERVER[REQUEST_METHOD] == 'GET') { 
-    $up   = $_GET['sort']; 
-    $down = $_GET['rsort']; 
-  } else {
-    $up   = $_POST['sort']; 
-    $down = $_POST['rsort']; 
+    $up   = $_GET['rsort']; 
+    $down = $_GET['sort']; 
+    $from = $_GET['from']; 
+  } else {
+    $up   = $_POST['rsort']; 
+    $down = $_POST['sort']; 
+    $from = $_POST['from']; 
+  }
+
+  // down button link
+  $link = "$baselink" . "&sort=$value";
+  if ($from != "") {
+    $link = $link . "&from=$from";
+  }
+  if ($down == $value) {
+    echo "<a href=\"$link\"><img src=\"down_sel.png\"></a>";
+  } else {
+    echo "<a href=\"$link\"><img src=\"down.png\"></a>";
   }
 
   // up button link
-  $link = "$baselink" . "&sort=$value";
+  $link = "$baselink" . "&rsort=$value";
+  if ($from != "") {
+    $link = $link . "&from=$from";
+  }
   if ($up == $value) {
     echo "<a href=\"$link\"><img src=\"up_sel.png\"></a>";
   } else {
     echo "<a href=\"$link\"><img src=\"up.png\"></a>";
-  }
-
-  // down button link
-  $link = "$baselink" . "&rsort=$value";
-  if ($down == $value) {
-    echo "<a href=\"$link\"><img src=\"down_sel.png\"></a>";
-  } else {
-    echo "<a href=\"$link\"><img src=\"down.png\"></a>";
   }
 
