Index: trunk/ippMonitor/czartool/czartool/Plotter.pm
===================================================================
--- trunk/ippMonitor/czartool/czartool/Plotter.pm	(revision 34097)
+++ trunk/ippMonitor/czartool/czartool/Plotter.pm	(revision 34109)
@@ -11,25 +11,26 @@
 
 my @allStages = (
-        "chip", 
-        "cam", 
-        "fake", 
-        "warp", 
-        "stack", 
-        "staticsky", 
-        "diff", 
-        "dist", 
+        "chip",
+        "cam",
+        "fake",
+        "warp",
+        "stack",
+        "staticsky",
+        "diff",
+        "dist",
         "pub",
         "chipbackground");
 
 my @allIppToPspsStages = (
-        "processed", 
-        "loaded_to_datastore", 
-        "loaded_to_ODM", 
-        "merge_worthy", 
-        "deleted_datastore", 
-        "deleted_dxlayer", 
-        "merged", 
+        "processed",
+        "loaded_to_datastore",
+        "loaded_to_ODM",
+        "merge_worthy",
+        "deleted_datastore",
+        "deleted_dxlayer",
+        "merged",
         "deleted_local");
 
+my $GNUPLOT="/home/panstarrs/ipp/local/bin/gnuplot";
 
 ###########################################################################
@@ -96,5 +97,5 @@
 ###########################################################################
 #
-# Sets plotter to use standard IPP mode, i.e. chip, cam etc 
+# Sets plotter to use standard IPP mode, i.e. chip, cam etc
 #
 ###########################################################################
@@ -107,5 +108,5 @@
 ###########################################################################
 #
-# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 
+# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc
 #
 ###########################################################################
@@ -182,5 +183,5 @@
 
     # stages
-    my $stages = undef;                 
+    my $stages = undef;
     if (!$selectedStage) {
         $stages = \@{$self->{allStages}};
@@ -196,5 +197,5 @@
     my $stage = undef;
     my $gnuplotFile = undef;
-    my $minX = 999999999;      
+    my $minX = 999999999;
     my $maxX = -9999999999;
     my $timeDiff = 0;
@@ -203,8 +204,8 @@
 
         if ($self->{_czarDb}->createProcessingRateData(
-                    $stage, 
-                    $label, 
-                    $beginTime, 
-                    $endTime, 
+                    $stage,
+                    $label,
+                    $beginTime,
+                    $endTime,
                     $interval,
                     \$gnuplotFile,
@@ -233,5 +234,5 @@
     my ($self, $gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval) = @_;
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -276,12 +277,12 @@
     my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_;
 
-    my $minX = 999999999;      
+    my $minX = 999999999;
     my $maxX = -9999999999;
     my $timeDiff = 0;
 
-    my $stages = undef;                 
+    my $stages = undef;
 
     if (!$selectedStage) {$stages = \@{$self->{allStages}};}
-    else {$stages = ["$selectedStage"]};        
+    else {$stages = ["$selectedStage"]};
 
     my %linDataFiles;
@@ -296,11 +297,11 @@
 
         if($self->{_czarDb}->createTimeSeriesData(
-                    $label, 
-                    $stage, 
-                    $beginTime, 
-                    $endTime, 
-                    \$minX, 
-                    \$maxX, 
-                    \$timeDiff, 
+                    $label,
+                    $stage,
+                    $beginTime,
+                    $endTime,
+                    \$minX,
+                    \$maxX,
+                    \$timeDiff,
                     \$linDataFile,
                     \$logDataFile,
@@ -311,5 +312,5 @@
             $ratDataFiles{$stage} = $ratDataFile;
         }
-    }                                                           
+    }
 
     my $numOfPlots =  keys(%linDataFiles);
@@ -319,5 +320,5 @@
 #        print "Warning: No plots could be generated for stage '$selectedStage' and label '$label' during time period '$beginTime', '$endTime'\n";
         return;
-    } 
+    }
 
     if ($timeDiff == 0) {
@@ -332,12 +333,12 @@
 
         $self->plotTimeSeries(
-                \%linDataFiles, 
-                $outputFile, 
-                $label, 
-                $beginTime, 
-                $endTime, 
-                $maxX, 
-                $minX, 
-                $timeDiff, 
+                \%linDataFiles,
+                $outputFile,
+                $label,
+                $beginTime,
+                $endTime,
+                $maxX,
+                $minX,
+                $timeDiff,
                 "",
                 "Items");
@@ -349,12 +350,12 @@
 
         $self->plotTimeSeries(
-                \%logDataFiles, 
-                $outputFile, 
-                $label, 
-                $beginTime, 
-                $endTime, 
-                $maxX, 
-                $minX, 
-                $timeDiff, 
+                \%logDataFiles,
+                $outputFile,
+                $label,
+                $beginTime,
+                $endTime,
+                $maxX,
+                $minX,
+                $timeDiff,
                 "",
                 "Log(Items)");
@@ -366,16 +367,16 @@
 
         $self->plotTimeSeries(
-                \%ratDataFiles, 
-                $outputFile, 
-                $label, 
-                $beginTime, 
-                $endTime, 
-                $maxX, 
-                $minX, 
-                $timeDiff, 
+                \%ratDataFiles,
+                $outputFile,
+                $label,
+                $beginTime,
+                $endTime,
+                $maxX,
+                $minX,
+                $timeDiff,
                 "",
                 "Items per hour");
-}    
-}                                                
+}
+}
 
 ###########################################################################
@@ -398,13 +399,13 @@
 
         if (!$self->{_czarDb}->countProcessedPendingAndFaults(
-                $label, 
-                $stage, 
-                $beginTime, 
-                $endTime, 
-                \$processed, 
-                \$pending, 
+                $label,
+                $stage,
+                $beginTime,
+                $endTime,
+                \$processed,
+                \$pending,
                 \$faults)) {next;}
 
-        $pendingMinusFaults = $pending - $faults; 
+        $pendingMinusFaults = $pending - $faults;
         print GNUDAT "$stage $faults $processed $pendingMinusFaults\n";
     }
@@ -412,5 +413,5 @@
     close(GNUDAT);
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -427,5 +428,5 @@
         "set ylabel \"Items\";" .
         "set boxwidth 0.75;" .
-        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 
+        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .
         "\n";
 
@@ -435,5 +436,5 @@
 ###########################################################################
 #
-# Sets the output path 
+# Sets the output path
 #
 ###########################################################################
@@ -441,9 +442,9 @@
     my ($self, $outputFormat) = @_;
     $self->{_outputFormat} = $outputFormat if defined($outputFormat);
-}           
-
-###########################################################################
-#
-# Sets the output type 
+}
+
+###########################################################################
+#
+# Sets the output type
 #
 ###########################################################################
@@ -451,5 +452,5 @@
     my ($self, $outputPath) = @_;
     $self->{_outputPath} = $outputPath if defined($outputPath);
-}           
+}
 
 ###########################################################################
@@ -462,5 +463,5 @@
     $self->{_dateFormat} = $dateFormat if defined($dateFormat);
     return $self->{_dateFormat};
-}       
+}
 
 ###########################################################################
@@ -543,5 +544,5 @@
     $title .= " for '$label'\\nFrom '$fromTime' to '$toTime' HST";
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -612,5 +613,5 @@
     $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat);
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -656,5 +657,5 @@
     my $totalPercent = sprintf("%.1f%%", $totalUsed);
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -672,8 +673,8 @@
         "plot '".$tmpFile->filename."' " .
         "using 2:xtic(1) t \"Used\" lt 7," .
-        "'' using 3 t \"Over $limit% used\" lt 1," . 
-        "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," . 
-        "'' using 5 t \"Free\" lt 2," . 
-        "'' using 6 notitle fs solid 0.50 lt -1" . 
+        "'' using 3 t \"Over $limit% used\" lt 1," .
+        "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
+        "'' using 5 t \"Free\" lt 2," .
+        "'' using 6 notitle fs solid 0.50 lt -1" .
         ";" .
 
@@ -718,5 +719,5 @@
 
 
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -731,6 +732,6 @@
         set grid
         set size square
-        set xrange [-0.5:7.5] reverse 
-        set yrange [-0.5:7.5]  
+        set xrange [-0.5:7.5] reverse
+        set yrange [-0.5:7.5]
         unset key
         set palette rgb 22,13,10
@@ -769,5 +770,5 @@
 
     # set up bins
-    my %histogram; 
+    my %histogram;
     my @bins;
     my $interval = 0.05;
@@ -812,5 +813,5 @@
 
     my $totalMaskFrac;
-    
+
     if ($totalChipCount > 0) {
 
@@ -842,5 +843,5 @@
 
     # make histogram
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -859,5 +860,5 @@
         "set boxwidth 0.75;" .
         "set xtic rotate by -90 scale 0;" .
-        "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" . 
+        "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" .
         "\n";
 
@@ -865,5 +866,5 @@
 
     # make cumulative distribution
-    open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
+    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
     use FileHandle;
     GP->autoflush(1);
@@ -878,5 +879,5 @@
         "set ylabel \"Number of Exposures\";" .
         "set xtic rotate by -90 scale 0;" .
-        "plot " . 
+        "plot " .
         "'".$tmpFile->filename."' using 1:3 notitle with lines lt 2 lw 2\n";
 
