Index: /tags/ipp-20100623/ippMonitor/Makefile.in
===================================================================
--- /tags/ipp-20100623/ippMonitor/Makefile.in	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/Makefile.in	(revision 28452)
@@ -16,5 +16,7 @@
 $(DESTBIN)/czartool_getLabels.pl \
 $(DESTBIN)/czartool_checkServer.pl \
-$(DESTBIN)/czartool_getServerStatus.pl
+$(DESTBIN)/czartool_getServerStatus.pl \
+$(DESTBIN)/build_histogram.dvo \
+
 
 RAWSRC = \
@@ -50,4 +52,6 @@
 $(DESTWWW)/czartool_labels.php \
 $(DESTWWW)/czartool_servers.php \
+$(DESTWWW)/histogram.php \
+$(DESTWWW)/show_and_delete_image.php \
 
 
@@ -121,4 +125,5 @@
 $(DESTWWW)/rawScienceExp.php \
 $(DESTWWW)/rawExp.php \
+$(DESTWWW)/rawSummary.php \
 $(DESTWWW)/rawExpStats.php \
 $(DESTWWW)/summitExp.php \
@@ -171,5 +176,6 @@
 $(DESTWWW)/flatcorrRun.php \
 $(DESTWWW)/flatcorrChip.php \
-$(DESTWWW)/flatcorrCamera.php
+$(DESTWWW)/flatcorrCamera.php \
+$(DESTWWW)/maskStats.php
 
 PICTURES = \
Index: /tags/ipp-20100623/ippMonitor/def/maskStats.d
===================================================================
--- /tags/ipp-20100623/ippMonitor/def/maskStats.d	(revision 28452)
+++ /tags/ipp-20100623/ippMonitor/def/maskStats.d	(revision 28452)
@@ -0,0 +1,50 @@
+TABLE rawExp, chipRun, camRun, fakeRun, warpRun
+TITLE Mask Stats
+FILE  maskStats.php
+MENU  ipp.imfiles.dat
+
+WHERE rawExp.exp_id = chipRun.exp_id
+WHERE chipRun.chip_id = camRun.chip_id
+WHERE camRun.cam_id = fakeRun.cam_id
+WHERE fakeRun.fake_id = warpRun.fake_id
+
+OP   OP1  $ra * 57.295783
+OP   OP2  $decl * 57.295783
+
+#        field              size format  name           show          link to   extras
+FIELD    rawExp.exp_name,    10,  %s,     Exp Name
+FIELD    rawExp.exp_id,       5,  %d,     Exp ID,        value,   rawImfile.php,  ARG1
+FIELD    rawExp.exp_type,     8,  %s,     Type    
+FIELD    rawExp.state,        5,  %s,     State
+FIELD    rawExp.obs_mode,     8,  %s,     obs mode
+FIELD    rawExp.dateobs,     19,  %T,     Date/Time
+FIELD    rawExp.ra,           8,  %C,     RA,           op=OP1      
+FIELD    rawExp.decl,         8,  %C,     DEC,          op=OP2
+FIELD    rawExp.filter,      10,  %s,     FILTER
+FIELD    rawExp.airmass,      5,  %.4f,   airmass     
+FIELD    rawExp.exp_time,     5,  %.2f,   exp_time    
+
+FIELD    chipRun.maskfrac_npix,         8,  %.3e,     chip npix   
+FIELD    camRun.maskfrac_ref_npix,     	8,  %.3e,     cam ref npix   
+FIELD    camRun.maskfrac_max_npix,     	8,  %.3e,     cam max npix   
+FIELD    warpRun.maskfrac_npix,     	8,  %.3e,     warp npix   
+
+FIELD    chipRun.maskfrac_static,   	8,  %.3f,     chip static 
+FIELD    camRun.maskfrac_ref_static,   	8,  %.3f,     cam ref static 
+FIELD    camRun.maskfrac_max_static,   	8,  %.3f,     cam max static 
+FIELD    warpRun.maskfrac_static,   	8,  %.3f,     warp static 
+
+FIELD    chipRun.maskfrac_dynamic,  	8,  %.3f,     chip dynamic
+FIELD    camRun.maskfrac_ref_dynamic,  	8,  %.3f,     cam ref dynamic
+FIELD    camRun.maskfrac_max_dynamic,  	8,  %.3f,     cam max dynamic
+FIELD    warpRun.maskfrac_dynamic,  	8,  %.3f,     warp dynamic
+
+FIELD    chipRun.maskfrac_magic,    	8,  %.3f,     chip magic  
+FIELD    camRun.maskfrac_ref_magic,    	8,  %.3f,     cam ref magic  
+FIELD    camRun.maskfrac_max_magic,    	8,  %.3f,     cam max magic  
+FIELD    warpRun.maskfrac_magic,    	8,  %.3f,     warp magic  
+
+FIELD    chipRun.maskfrac_advisory, 	8,  %.3f,     chip advisory
+FIELD    camRun.maskfrac_ref_advisory, 	8,  %.3f,     cam ref advisory
+FIELD    camRun.maskfrac_max_advisory, 	8,  %.3f,     cam max advisory
+FIELD    warpRun.maskfrac_advisory,     8,  %.3f,     warp advisory 
Index: /tags/ipp-20100623/ippMonitor/def/rawExp.d
===================================================================
--- /tags/ipp-20100623/ippMonitor/def/rawExp.d	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/def/rawExp.d	(revision 28452)
@@ -15,4 +15,5 @@
 FIELD    camera,      10,  %s,     Camera
 FIELD    exp_type,     8,  %s,     Type    
+FIELD    obs_mode,     8,  %s,     obs mode
 FIELD    dateobs,     19,  %T,     Date/Time
 FIELD    ra,           8,  %C, RA,           op=OP1      
Index: /tags/ipp-20100623/ippMonitor/def/rawSummary.d
===================================================================
--- /tags/ipp-20100623/ippMonitor/def/rawSummary.d	(revision 28452)
+++ /tags/ipp-20100623/ippMonitor/def/rawSummary.d	(revision 28452)
@@ -0,0 +1,17 @@
+TABLE rawExp
+TITLE Raw Summary
+FILE  rawSummary.php
+MENU  ipp.load.dat
+
+#     field            size  format  name         show    link to         extras
+FIELD exp_type,    	 15, %s,     OBSTYPE
+FIELD obs_mode,    	 15, %s,     OBS_MODE
+FIELD state,    	  7, %s,     state
+FIELD MIN(dateobs),    	  19, %T,    min date
+FIELD MAX(dateobs),    	  19, %T,    max date
+FIELD count(exp_id) as n, 7, %d,     count
+
+MODE  summary
+GROUP state
+GROUP exp_type
+GROUP obs_mode
Index: /tags/ipp-20100623/ippMonitor/raw/czartool_labels.php
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/czartool_labels.php	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/raw/czartool_labels.php	(revision 28452)
@@ -95,9 +95,9 @@
         $str = "";
         $anyFaults = false; 
-        $link = "chipProcessedImfile_failure.php?menu=ipp.science.dat&pass=" . $pass . "&proj=" . $proj . "&label=" . $stdsLabel;
+        $link = "chipProcessedImfile_failure.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $label . "&chipRun.state=new";
         getStateAndFaults($db, $label,"chipRun", $state, "chip", $str, $anyFaults);
         write_table_cell($class, '%s', $anyFaults ? $link : "", $str);
 
-        $link = "camProcessedExp_failure.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $stdsLabel;
+        $link = "camProcessedExp_failure.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $label . "&camRun.state=new";
         getStateAndFaults($db, $label,"camRun", $state, "cam", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
@@ -107,13 +107,13 @@
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
 
-        $link = "warpFailedSkyfiles.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "warpFailedSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $label . "&warpRun.state=new";
         getStateAndFaults($db, $label,"warpRun", $state, "warp", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
         
-        $link = "stackFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "stackFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $label . "&stackRun.state=new";
         getStateAndFaults($db, $label,"stackRun", $state, "stack", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
 
-        $link = "diffFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "diffFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $label . "&diffRun.state=new";
         getStateAndFaults($db, $label,"diffRun", $state, "diff", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
@@ -189,9 +189,9 @@
         $anyFaults = false; 
 
-        $link = "chipProcessedImfile_failure.php?menu=ipp.science.dat&pass=" . $pass . "&proj=" . $proj . "&label=" . $stdsLabel;
+        $link = "chipProcessedImfile_failure.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $stdsLabel . "&chipRun.state=new";
         getStateAndFaults($db, $stdsLabel,"chipRun", $selectedState, "chip", $str, $anyFaults);
         write_table_cell($class, '%s', $anyFaults ? $link : "", $str);
 
-        $link = "camProcessedExp_failure.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $stdsLabel;
+        $link = "camProcessedExp_failure.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $stdsLabel . "&camRun.state=new";
         getStateAndFaults($db, $stdsLabel,"camRun", $selectedState, "cam", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
@@ -201,13 +201,13 @@
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
 
-        $link = "warpFailedSkyfiles.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "warpFailedSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $stdsLabel . "&warpRun.state=new";
         getStateAndFaults($db, $stdsLabel,"warpRun", $selectedState, "warp", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
         
-        $link = "stackFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "stackFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $stdsLabel . "&stackRun.state=new";
         getStateAndFaults($db, $stdsLabel,"stackRun", $selectedState, "stack", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
 
-        $link = "diffFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj;
+        $link = "diffFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $stdsLabel . "&diffRun.state=new";
         getStateAndFaults($db, $stdsLabel,"diffRun", $selectedState, "diff", $str, $anyFaults);
         write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
Index: /tags/ipp-20100623/ippMonitor/raw/histogram.php
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/histogram.php	(revision 28452)
+++ /tags/ipp-20100623/ippMonitor/raw/histogram.php	(revision 28452)
@@ -0,0 +1,472 @@
+<?php 
+
+$debug = 0;
+
+include 'ipp.php';
+
+$ID = checkID ();
+
+$filesToRemove = array();
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
+
+if ($ID['menu']) {
+  $myMenu = $ID['menu'];
+} else {
+  $myMenu = "ipp.imfiles.dat";
+}
+
+menu($myMenu, 'Histogram', 'ipp.css', $ID['link'], $ID['proj']);
+
+echo "<p> Histogram </p>";
+
+// set up the form
+echo "<form action=\"histogram.php\" method=\"POST\">\n";
+
+$restricted = 0;
+
+// define restrictiosn to the queries
+// ** TABLE RESTRICTIONS **
+$WHERE = "WHERE camRun.state = 'full' AND camRun.chip_id = chipRun.chip_id AND chipRun.exp_id = rawExp.exp_id AND camProcessedExp.cam_id  = camRun.cam_id AND camProcessedExp.fault = 0";
+$WHERE = check_restrict ('rawExp.exp_name', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('chipRun.label', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('chipRun.data_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('chipRun.dist_group', $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.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 ('camProcessedExp.fwhm_major', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_uq', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_uq', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_uq', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_lq', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_lq', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_major_lq', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_uq', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_uq', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_uq', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_lq', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_lq', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.fwhm_minor_lq', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_major', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_major', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_major', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_minor', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_minor', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_fwhm_minor', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m2', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m2', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m2', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m3', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m3', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m3', $WHERE, 'max', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m4', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m4', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('camProcessedExp.iq_m4', $WHERE, 'max', 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 camRun, chipRun, rawExp, camProcessedExp $WHERE";
+}
+if (basic == "summary") {
+  $sql = "SELECT count(*) FROM (SELECT rawExp.exp_name,chipRun.label,chipRun.data_group,chipRun.dist_group,rawExp.dateobs,rawExp.filter,rawExp.exp_time,rawExp.airmass,camProcessedExp.fwhm_major,camProcessedExp.fwhm_minor,camProcessedExp.fwhm_major_uq,camProcessedExp.fwhm_major_lq,camProcessedExp.fwhm_minor_uq,camProcessedExp.fwhm_minor_lq,camProcessedExp.iq_fwhm_major,camProcessedExp.iq_fwhm_minor,camProcessedExp.iq_m2,camProcessedExp.iq_m3,camProcessedExp.iq_m4 FROM camRun, chipRun, rawExp, camProcessedExp $WHERE) as TEMP";
+}
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading camRun, chipRun, rawExp, camProcessedExp 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 camRun, chipRun, rawExp, camProcessedExp 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,chipRun.label,chipRun.data_group,chipRun.dist_group,rawExp.dateobs,rawExp.filter,rawExp.exp_time,rawExp.airmass,camProcessedExp.fwhm_major,camProcessedExp.fwhm_minor,camProcessedExp.fwhm_major_uq,camProcessedExp.fwhm_major_lq,camProcessedExp.fwhm_minor_uq,camProcessedExp.fwhm_minor_lq,camProcessedExp.iq_fwhm_major,camProcessedExp.iq_fwhm_minor,camProcessedExp.iq_m2,camProcessedExp.iq_m3,camProcessedExp.iq_m4 FROM camRun, chipRun, rawExp, camProcessedExp $WHERE";
+}
+if (basic == "summary") {
+  $sql = "SELECT rawExp.exp_name,chipRun.label,chipRun.data_group,chipRun.dist_group,rawExp.dateobs,rawExp.filter,rawExp.exp_time,rawExp.airmass,camProcessedExp.fwhm_major,camProcessedExp.fwhm_minor,camProcessedExp.fwhm_major_uq,camProcessedExp.fwhm_major_lq,camProcessedExp.fwhm_minor_uq,camProcessedExp.fwhm_minor_lq,camProcessedExp.iq_fwhm_major,camProcessedExp.iq_fwhm_minor,camProcessedExp.iq_m2,camProcessedExp.iq_m3,camProcessedExp.iq_m4 FROM camRun, chipRun, rawExp, camProcessedExp $WHERE";
+}
+
+$qry = $db->query($sql);
+if (dberror($qry)) {
+  echo "<b>error reading camRun, chipRun, rawExp, camProcessedExp 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 ('chipRun.label', $buttonLink);
+$buttonLink = button_restrict_string ('chipRun.data_group', $buttonLink);
+$buttonLink = button_restrict_string ('chipRun.dist_group', $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.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 ('camProcessedExp.fwhm_major', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_major', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_major', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_major_uq', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_major_uq', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_major_uq', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_major_lq', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_major_lq', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_major_lq', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_minor_uq', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_minor_uq', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_minor_uq', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.fwhm_minor_lq', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.fwhm_minor_lq', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.fwhm_minor_lq', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.iq_fwhm_major', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.iq_fwhm_major', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.iq_fwhm_major', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.iq_fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.iq_fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.iq_fwhm_minor', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.iq_m2', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.iq_m2', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.iq_m2', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.iq_m3', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.iq_m3', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.iq_m3', $buttonLink);
+$buttonLink = button_restrict_string ('camProcessedExp.iq_m4', $buttonLink);
+$buttonLink = button_restrict_min ('camProcessedExp.iq_m4', $buttonLink);
+$buttonLink = button_restrict_max ('camProcessedExp.iq_m4', $buttonLink);
+
+$buttonLink = button_restrict_checkbox ('hist.exp_time', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.airmass', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_major_psf', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_minor_psf', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_uq', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_lq', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_major_moments', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_minor_moments', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_m2_moment', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_m3_moment', $buttonLink);
+$buttonLink = button_restrict_checkbox ('hist.fwhm_m4_moment', $buttonLink);
+
+$buttonLink = button_restrict_string ('hist_delta.exp_time', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.airmass', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_major_psf', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_minor_psf', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_uq', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_lq', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_major_moments', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_minor_moments', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_m2_moment', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_m3_moment', $buttonLink);
+$buttonLink = button_restrict_string ('hist_delta.fwhm_m4_moment', $buttonLink);
+
+navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, 'histogram.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", "Label");
+write_header_cell ("list", "data grp");
+write_header_cell ("list", "dist grp");
+write_header_cell ("list", "Date/Time");
+write_header_cell ("list", "FILTER");
+write_header_cell ("list", "exp_time    ");
+write_header_cell ("list", "airmass     ");
+write_header_cell ("list", "fwhm major psf");
+write_header_cell ("list", "fwhm minor psf");
+write_header_cell ("list", "fwhm UQ");
+write_header_cell ("list", "fwhm LQ");
+write_header_cell ("list", "fwhm major moments");
+write_header_cell ("list", "fwhm minor moments");
+write_header_cell ("list", "m2 moment");
+write_header_cell ("list", "m3 moment");
+write_header_cell ("list", "m4 moment");
+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 ('chipRun.label', 7, 'string');
+write_query_row ('chipRun.data_group', 7, 'string');
+write_query_row ('chipRun.dist_group', 7, 'string');
+write_query_row ('rawExp.dateobs', 19, 'min');
+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 ('camProcessedExp.fwhm_major', 5, 'min');
+write_query_row ('camProcessedExp.fwhm_minor', 5, 'min');
+write_query_row ('camProcessedExp.fwhm_major_uq', 5, 'min');
+write_query_row ('camProcessedExp.fwhm_major_lq', 5, 'min');
+write_query_row ('camProcessedExp.iq_fwhm_major', 5, 'min');
+write_query_row ('camProcessedExp.iq_fwhm_minor', 5, 'min');
+write_query_row ('camProcessedExp.iq_m2', 5, 'min');
+write_query_row ('camProcessedExp.iq_m3', 5, 'min');
+write_query_row ('camProcessedExp.iq_m4', 5, 'min');
+echo "</tr><tr><td>&le;</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');
+echo "<td> &nbsp; </td>\n";
+write_query_row ('rawExp.exp_time', 5, 'max');
+write_query_row ('rawExp.airmass', 5, 'max');
+write_query_row ('camProcessedExp.fwhm_major', 5, 'max');
+write_query_row ('camProcessedExp.fwhm_minor', 5, 'max');
+write_query_row ('camProcessedExp.fwhm_major_uq', 5, 'max');
+write_query_row ('camProcessedExp.fwhm_major_lq', 5, 'max');
+write_query_row ('camProcessedExp.iq_fwhm_major', 5, 'max');
+write_query_row ('camProcessedExp.iq_fwhm_minor', 5, 'max');
+write_query_row ('camProcessedExp.iq_m2', 5, 'max');
+write_query_row ('camProcessedExp.iq_m3', 5, 'max');
+write_query_row ('camProcessedExp.iq_m4', 5, 'max');
+echo "</tr>\n";
+// echo "</tr>\n";
+
+//checkboxes
+echo "<tr><td></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";//dateobs
+echo "<td> &nbsp; </td>\n";
+write_query_checkbox ('hist.exp_time', 'Histogram?');
+write_query_checkbox ('hist.airmass', 'Histogram?');
+write_query_checkbox ('hist.fwhm_major_psf', 'Histogram?');
+write_query_checkbox ('hist.fwhm_minor_psf', 'Histogram?');
+write_query_checkbox ('hist.fwhm_uq', 'Histogram?');
+write_query_checkbox ('hist.fwhm_lq', 'Histogram?');
+write_query_checkbox ('hist.fwhm_major_moments', 'Histogram?');
+write_query_checkbox ('hist.fwhm_minor_moments', 'Histogram?');
+write_query_checkbox ('hist.fwhm_m2_moment', 'Histogram?');
+write_query_checkbox ('hist.fwhm_m3_moment', 'Histogram?');
+write_query_checkbox ('hist.fwhm_m4_moment', 'Histogram?');
+echo "</tr>\n";
+
+echo "<tr><td></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> Bin size (delta)</td>\n";
+write_query_row ('hist.exp_time_delta', 5, 'string');
+write_query_row ('hist.airmass_delta', 5, 'string');
+write_query_row ('hist.fwhm_major_psf_delta', 5, 'string');
+write_query_row ('hist.fwhm_minor_psf_delta', 5, 'string');
+write_query_row ('hist.fwhm_uq_delta', 5, 'string');
+write_query_row ('hist.fwhm_lq_delta', 5, 'string');
+write_query_row ('hist.fwhm_major_moments_delta', 5, 'string');
+write_query_row ('hist.fwhm_minor_moments_delta', 5, 'string');
+write_query_row ('hist.fwhm_m2_moment_delta', 5, 'string');
+write_query_row ('hist.fwhm_m3_moment_delta', 5, 'string');
+write_query_row ('hist.fwhm_m4_moment_delta', 5, 'string');
+echo "</tr>\n";
+
+echo "<tr><td></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> Bins number (default: 100)</td>\n";
+write_query_row ('hist.exp_time_count', 5, 'string');
+write_query_row ('hist.airmass_count', 5, 'string');
+write_query_row ('hist.fwhm_major_psf_count', 5, 'string');
+write_query_row ('hist.fwhm_minor_psf_count', 5, 'string');
+write_query_row ('hist.fwhm_uq_count', 5, 'string');
+write_query_row ('hist.fwhm_lq_count', 5, 'string');
+write_query_row ('hist.fwhm_major_moments_count', 5, 'string');
+write_query_row ('hist.fwhm_minor_moments_count', 5, 'string');
+write_query_row ('hist.fwhm_m2_moment_count', 5, 'string');
+write_query_row ('hist.fwhm_m3_moment_count', 5, 'string');
+write_query_row ('hist.fwhm_m4_moment_count', 5, 'string');
+echo "</tr>\n";
+
+// close the table and form
+echo "</table>\n";
+echo "<a href=\"http://en.wikipedia.org/wiki/Histogram#Number_of_bins_and_width\">About the \"good\" number of bins<br><br></a>\n";
+echo "<input type=\"submit\" name=\"constraints\" value=\"refine search/show histograms\">\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";
+
+$keysToRowIndex = array( 
+      'hist.exp_time' => 6,
+      'hist.airmass' => 7,
+      'hist.fwhm_major_psf' => 8,
+      'hist.fwhm_minor_psf' => 9,
+      'hist.fwhm_uq'=> 10,
+      'hist.fwhm_lq' => 11,
+      'hist.fwhm_major_moments' => 12,
+      'hist.fwhm_minor_moments' => 13,
+      'hist.fwhm_m2_moment' => 14,
+      'hist.fwhm_m3_moment' => 15,
+      'hist.fwhm_m4_moment' =>16);
+$handles = array();
+$filenames = array();
+foreach ($keysToRowIndex as $i => $value) {
+    if (get_value_from_key($i, TRUE) == "on") {
+       $filenames[$i] = tempnam("/tmp/serge", "histodat.");
+       if ($debug) {
+          echo "<b>Using $filenames[$i] for $i</b>\n";
+       }
+       $handles[$i] = fopen($filenames[$i], "w");
+    }
+}
+// ** TAIL CODE **
+while ($qry->fetchInto($row)) {
+  foreach ($keysToRowIndex as $i => $value) {
+    if (get_value_from_key($i, TRUE) == "on") {
+      fwrite($handles[$i],
+	sprintf("%.3f\n", $row[$value]));
+    }
+  }
+}
+foreach ($keysToRowIndex as $i => $value) {
+  if ($handles[$i] != NULL) {
+    fclose($handles[$i]);
+    chmod($filenames[$i], 0777);
+  }
+}
+
+if ($debug) {
+   $show = get_value_from_key('hist.exp_time', TRUE);
+   $show .= " && ".get_value_from_key('hist.airmass', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_major_psf', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_minor_psf', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_uq', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_lq', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_major_moments', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_minor_moments', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_m2_moment', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_m3_moment', TRUE);
+   $show .= " && ".get_value_from_key('hist.fwhm_m4_moment', TRUE);
+   echo "==&gt; ($show)<br>\n";
+}
+
+//Get environment
+$PATH = getenv("PATH");
+putenv("PATH=$BINDIR:$PATH");
+$LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH");
+putenv("LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH");
+
+echo "<br>\n";
+foreach ($filenames as $i => $value) {
+  $outfile = $value.".png";
+  $deltaValue = get_value_from_key($i."_delta", TRUE);
+  $binValue = get_value_from_key($i."_count", TRUE);
+  if ($binValue == "") {
+     $binValue = "-1";
+     if ($deltaValue == "") {
+       $binValue = "100";
+       $deltaValue = "-1";
+     }    
+  } else {
+    if ($deltaValue != "") {
+      echo "<font color=red>Warning! Both 'Bins number' and 'delta value' are specified =&gt; 'delta value' will be ignored<br></font>\n";
+      $deltaValue = "-1";
+    } else {
+      $deltaValue = "-1";
+    }
+  }
+  $title = preg_replace ('|hist\.|', '', $i);
+  $title = preg_replace ('|_|', '-', $title);
+
+  echo "Showing histogram for [$title] /  delta = $deltaValue / bins = $binValue<br>\n";
+  exec("build_histogram.dvo $value $outfile $deltaValue $binValue $title",
+  	$output, $status);
+  if ($debug) {
+    echo "&nbsp;&nbsp;&nbsp;&nbsp;Status = $status<br>\n";
+    for ($i = 0; $i < count($output); $i++) {
+      echo "&nbsp;&nbsp;&nbsp;&nbsp;output $i: $output[$i]<br>";
+    }
+  }
+  $blah=count($output);
+  if ($debug) {
+    echo "&nbsp;&nbsp;&nbsp;&nbsp;end: $output / $blah<br>\n";
+  }
+  echo "<img src=\"show_and_delete_image.php?file=$outfile\"><br><br>\n";
+  unset($output);
+  $filesToRemove[$value] = '';
+}
+
+echo "<small> WHERE: $WHERE<br><br></small>\n";
+echo "<small> SQL: $sql<br><br></small>\n";
+
+if ($debug) {
+  echo "Cleaning<br>\n";
+}
+foreach ($filesToRemove as $index => $value) {
+  if ($debug) {
+    echo "Deleting $index<br>\n";
+  }
+  unlink($index);
+}
+if ($debug) {
+  echo "Cleaning end<br>\n";
+}
+
+menu_end();
+
+?>
Index: /tags/ipp-20100623/ippMonitor/raw/ipp.imfiles.dat
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/ipp.imfiles.dat	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/raw/ipp.imfiles.dat	(revision 28452)
@@ -22,3 +22,4 @@
 menutop   | menutop      | link    | simple plot - cam            | simplePlotcam.php
 menutop   | menutop      | link    | czartool                     | czartool_labels.php
-
+menutop   | menutop      | link    | mask stats                   | maskStats.php
+menutop   | menutop      | link    | histogram                    | histogram.php
Index: /tags/ipp-20100623/ippMonitor/raw/ipp.load.dat
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/ipp.load.dat	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/raw/ipp.load.dat	(revision 28452)
@@ -2,4 +2,5 @@
 
 menutop   | menutop      | plain   | &nbsp;                       | 
+menulink  | menuselect 	 | link    | Raw Exp Summary              | rawSummary.php             
 menulink  | menuselect 	 | link    | Raw Exposures                | rawExp.php             
 menulink  | menuselect 	 | link    | Raw Detrend Exp              | rawDetrendExp.php             
Index: /tags/ipp-20100623/ippMonitor/raw/ipp.php
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/ipp.php	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/raw/ipp.php	(revision 28452)
@@ -564,6 +564,41 @@
 }
 
+// 
+function button_restrict_checkbox ($key, $line) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") {
+    if ($line) {
+      $line = $line . "&$htmlkey=$value";
+    } else {
+      $line = "$htmlkey=$value";
+    }
+  }
+  return $line;
+}
+
+// 
+function button_restrict_radio ($key, $line) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") {
+    if ($line) {
+      $line = $line . "&$htmlkey=$value";
+    } else {
+      $line = "$htmlkey=$value";
+    }
+  }
+  return $line;
+}
+
 function write_header_cell ($class, $name) {
-
   echo "<th class=\"$class\">$name</th>\n";
 }
@@ -637,6 +672,45 @@
   if ($value != "") { 
     echo "value=\"$value\">";
-  } 
+  } else {
+    echo ">";
+  }
   echo "</td>\n";
+}
+
+// checkbox
+function write_query_checkbox ($key, $comment) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  echo "<td> <input type=\"checkbox\" name=\"$htmlkey\"";
+  if ($value == "on") { 
+    echo " checked>";
+  } else {
+    echo ">";
+  }
+  echo "$comment ($htmlkey/$value)</td>\n";
+}
+
+// checkbox
+function write_query_radio ($value, $key) {
+  $htmlkey = preg_replace ('| |', '_', $key);
+  $htmlvalue = preg_replace ('|\.|', '_', $value);
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($htmlvalue == get_value_from_key($htmlkey, TRUE)) {
+    $checked = "checked";
+  } else {
+    $checked = "";
+  }
+  echo "<td> <input type=\"radio\" name=\"$htmlkey\" value=\"$htmlvalue\" $checked/>";
+  echo "$key ($htmlkey/$htmlvalue)</td>\n";
 }
 
@@ -778,3 +852,22 @@
 // $myPage = $_SERVER[SCRIPT_NAME] . "?pass=$pass";
 
+//////////////////////////////////////////////////////////////////////////
+// Return the value associated to the key (GET or POST method)
+// If convertKeyToHtmlkey is true, the key is converted to a 
+// so-called HTML, i.e. the key where '.' are replaced by '_'
+// (e.g. the conversion of 'f.o.o.b_a_r' is 'f_o_o_b_a_r'.
+//
+function get_value_from_key ($key, $convertKeyToHtmlkey) {
+  if ($convertKeyToHtmlkey) {
+    $htmlkey = preg_replace ('|\.|', '_', $key);
+  } else {
+    $htmlkey = $key;
+  }
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    return $_GET[$htmlkey]; 
+  } else {
+    return $_POST[$htmlkey]; 
+  }
+}
+
 ?>
Index: /tags/ipp-20100623/ippMonitor/raw/show_and_delete_image.php
===================================================================
--- /tags/ipp-20100623/ippMonitor/raw/show_and_delete_image.php	(revision 28452)
+++ /tags/ipp-20100623/ippMonitor/raw/show_and_delete_image.php	(revision 28452)
@@ -0,0 +1,18 @@
+<?php
+
+### we must have been past arguments with GET:
+if ($_SERVER[REQUEST_METHOD] != 'GET') { 
+  exit ();
+}
+
+$filename = $_GET[file];
+
+$file = fopen ($filename, "r");
+if ($file && !$debug) {
+  header ('Content-Type: image/png');
+  fpassthru ($file);
+}
+
+unlink($filename);
+exit ();
+?>
Index: /tags/ipp-20100623/ippMonitor/scripts/build_histogram.dvo
===================================================================
--- /tags/ipp-20100623/ippMonitor/scripts/build_histogram.dvo	(revision 28452)
+++ /tags/ipp-20100623/ippMonitor/scripts/build_histogram.dvo	(revision 28452)
@@ -0,0 +1,78 @@
+#!/usr/bin/env dvo
+
+$debug = 0
+
+$bins = 100
+$delta = -1
+
+macro build_histogram
+  myecho "Loading data from = $1"
+  data $1
+  read v 1
+  minimum v
+  maximum v
+  myecho "minvalue = $minvalue"
+  myecho "maxvalue = $maxvalue"
+
+  if ($bins >= 2)
+    $delta = ($maxvalue-$minvalue)/$bins
+    myecho "delta = $delta"
+  else
+    if ($delta <= 0)
+      $bins = 100
+      $delta = ($maxvalue-$minvalue)/$bins
+      myecho "delta = $delta"
+    end
+  end
+
+  histo v vhist $minvalue $maxvalue $delta -range dx
+  myecho "bins = dx[]"
+  myecho "  Setting limits"
+  limits dx vhist
+  plot dx vhist -x 1
+  clear
+  myecho "  Showing box"
+  box
+  myecho "  Plotting"
+  plot dx vhist -x 1 -c blue
+  $binsCount = dx[]
+  myecho "  Labeling"
+  myecho "    -x $3"
+  myecho "    -y Occurrences "
+  myecho "    +x 'Histogram of $3 "
+  myecho "           interval = $minvalue : $maxvalue "
+  myecho "	     / $binsCount bins"
+  myecho "           / bin width: $delta)'"
+  labels -x $3
+  labels -y Occurrences
+  labels +x "Histogram of $3 / interval = $minvalue : $maxvalue / $binsCount bins / bin width: $delta"
+
+  myecho "Saving graphics to [$2]"
+  png -name $2
+end
+
+if ($SCRIPT)
+  $KAPA = kapa -noX
+  resize 1000 1000
+  if ($argv:n != 5)
+    echo "USAGE: build_histogram (input) (output) (delta) (bins) (x-axis label)"
+    echo "  If (bins) >= 2"
+    echo "     build histogram with (bins) bins ((delta) is ignored)"
+    echo "  Otherwise"
+    echo "     if delta > 0
+    echo "        build histogram with (delta)-wide bins"
+    echo "     otherwise"
+    echo "        build histogram with 100 bins"
+    exit 1
+  end
+
+  echo "Loading dependencies"
+  $helpersFilename = `which helpers.dvo`
+  input $helpersFilename
+  echo "Dependencies loaded"
+
+  $bins = $argv:3 + 1
+  $delta = $argv:2
+  build_histogram $argv:0 $argv:1 $argv:4
+  exit 0
+end
Index: /tags/ipp-20100623/ippMonitor/scripts/czartool_checkServer.pl
===================================================================
--- /tags/ipp-20100623/ippMonitor/scripts/czartool_checkServer.pl	(revision 28451)
+++ /tags/ipp-20100623/ippMonitor/scripts/czartool_checkServer.pl	(revision 28452)
@@ -17,5 +17,5 @@
     if ($line =~ m/Scheduler is stopped/) {$isRunning = 0; $foundStatus=1;last;}
     if ($line =~ m/Scheduler is running/) {$isRunning = 1; $foundStatus=1;last;}
-    if ($line =~ m/Task Staus/) {last;}
+    if ($line =~ m/Task Status/) {last;}
 
 }
