IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34109


Ignore:
Timestamp:
Jun 29, 2012, 1:27:29 PM (14 years ago)
Author:
Serge CHASTEL
Message:

Changed gnuplot version to local one (4.6p0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/czartool/czartool/Plotter.pm

    r34096 r34109  
    1111
    1212my @allStages = (
    13         "chip", 
    14         "cam", 
    15         "fake", 
    16         "warp", 
    17         "stack", 
    18         "staticsky", 
    19         "diff", 
    20         "dist", 
     13        "chip",
     14        "cam",
     15        "fake",
     16        "warp",
     17        "stack",
     18        "staticsky",
     19        "diff",
     20        "dist",
    2121        "pub",
    2222        "chipbackground");
    2323
    2424my @allIppToPspsStages = (
    25         "processed", 
    26         "loaded_to_datastore", 
    27         "loaded_to_ODM", 
    28         "merge_worthy", 
    29         "deleted_datastore", 
    30         "deleted_dxlayer", 
    31         "merged", 
     25        "processed",
     26        "loaded_to_datastore",
     27        "loaded_to_ODM",
     28        "merge_worthy",
     29        "deleted_datastore",
     30        "deleted_dxlayer",
     31        "merged",
    3232        "deleted_local");
    3333
     34my $GNUPLOT="/home/panstarrs/ipp/local/bin/gnuplot";
    3435
    3536###########################################################################
     
    9697###########################################################################
    9798#
    98 # Sets plotter to use standard IPP mode, i.e. chip, cam etc 
     99# Sets plotter to use standard IPP mode, i.e. chip, cam etc
    99100#
    100101###########################################################################
     
    107108###########################################################################
    108109#
    109 # Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 
     110# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc
    110111#
    111112###########################################################################
     
    182183
    183184    # stages
    184     my $stages = undef;                 
     185    my $stages = undef;
    185186    if (!$selectedStage) {
    186187        $stages = \@{$self->{allStages}};
     
    196197    my $stage = undef;
    197198    my $gnuplotFile = undef;
    198     my $minX = 999999999;     
     199    my $minX = 999999999;
    199200    my $maxX = -9999999999;
    200201    my $timeDiff = 0;
     
    203204
    204205        if ($self->{_czarDb}->createProcessingRateData(
    205                     $stage, 
    206                     $label, 
    207                     $beginTime, 
    208                     $endTime, 
     206                    $stage,
     207                    $label,
     208                    $beginTime,
     209                    $endTime,
    209210                    $interval,
    210211                    \$gnuplotFile,
     
    233234    my ($self, $gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval) = @_;
    234235
    235     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     236    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    236237    use FileHandle;
    237238    GP->autoflush(1);
     
    276277    my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_;
    277278
    278     my $minX = 999999999;     
     279    my $minX = 999999999;
    279280    my $maxX = -9999999999;
    280281    my $timeDiff = 0;
    281282
    282     my $stages = undef;                 
     283    my $stages = undef;
    283284
    284285    if (!$selectedStage) {$stages = \@{$self->{allStages}};}
    285     else {$stages = ["$selectedStage"]};       
     286    else {$stages = ["$selectedStage"]};
    286287
    287288    my %linDataFiles;
     
    296297
    297298        if($self->{_czarDb}->createTimeSeriesData(
    298                     $label, 
    299                     $stage, 
    300                     $beginTime, 
    301                     $endTime, 
    302                     \$minX, 
    303                     \$maxX, 
    304                     \$timeDiff, 
     299                    $label,
     300                    $stage,
     301                    $beginTime,
     302                    $endTime,
     303                    \$minX,
     304                    \$maxX,
     305                    \$timeDiff,
    305306                    \$linDataFile,
    306307                    \$logDataFile,
     
    311312            $ratDataFiles{$stage} = $ratDataFile;
    312313        }
    313     }                                                           
     314    }
    314315
    315316    my $numOfPlots =  keys(%linDataFiles);
     
    319320#        print "Warning: No plots could be generated for stage '$selectedStage' and label '$label' during time period '$beginTime', '$endTime'\n";
    320321        return;
    321     } 
     322    }
    322323
    323324    if ($timeDiff == 0) {
     
    332333
    333334        $self->plotTimeSeries(
    334                 \%linDataFiles, 
    335                 $outputFile, 
    336                 $label, 
    337                 $beginTime, 
    338                 $endTime, 
    339                 $maxX, 
    340                 $minX, 
    341                 $timeDiff, 
     335                \%linDataFiles,
     336                $outputFile,
     337                $label,
     338                $beginTime,
     339                $endTime,
     340                $maxX,
     341                $minX,
     342                $timeDiff,
    342343                "",
    343344                "Items");
     
    349350
    350351        $self->plotTimeSeries(
    351                 \%logDataFiles, 
    352                 $outputFile, 
    353                 $label, 
    354                 $beginTime, 
    355                 $endTime, 
    356                 $maxX, 
    357                 $minX, 
    358                 $timeDiff, 
     352                \%logDataFiles,
     353                $outputFile,
     354                $label,
     355                $beginTime,
     356                $endTime,
     357                $maxX,
     358                $minX,
     359                $timeDiff,
    359360                "",
    360361                "Log(Items)");
     
    366367
    367368        $self->plotTimeSeries(
    368                 \%ratDataFiles, 
    369                 $outputFile, 
    370                 $label, 
    371                 $beginTime, 
    372                 $endTime, 
    373                 $maxX, 
    374                 $minX, 
    375                 $timeDiff, 
     369                \%ratDataFiles,
     370                $outputFile,
     371                $label,
     372                $beginTime,
     373                $endTime,
     374                $maxX,
     375                $minX,
     376                $timeDiff,
    376377                "",
    377378                "Items per hour");
    378 }   
    379 }                                               
     379}
     380}
    380381
    381382###########################################################################
     
    398399
    399400        if (!$self->{_czarDb}->countProcessedPendingAndFaults(
    400                 $label, 
    401                 $stage, 
    402                 $beginTime, 
    403                 $endTime, 
    404                 \$processed, 
    405                 \$pending, 
     401                $label,
     402                $stage,
     403                $beginTime,
     404                $endTime,
     405                \$processed,
     406                \$pending,
    406407                \$faults)) {next;}
    407408
    408         $pendingMinusFaults = $pending - $faults; 
     409        $pendingMinusFaults = $pending - $faults;
    409410        print GNUDAT "$stage $faults $processed $pendingMinusFaults\n";
    410411    }
     
    412413    close(GNUDAT);
    413414
    414     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     415    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    415416    use FileHandle;
    416417    GP->autoflush(1);
     
    427428        "set ylabel \"Items\";" .
    428429        "set boxwidth 0.75;" .
    429         "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 
     430        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .
    430431        "\n";
    431432
     
    435436###########################################################################
    436437#
    437 # Sets the output path 
     438# Sets the output path
    438439#
    439440###########################################################################
     
    441442    my ($self, $outputFormat) = @_;
    442443    $self->{_outputFormat} = $outputFormat if defined($outputFormat);
    443 }           
    444 
    445 ###########################################################################
    446 #
    447 # Sets the output type 
     444}
     445
     446###########################################################################
     447#
     448# Sets the output type
    448449#
    449450###########################################################################
     
    451452    my ($self, $outputPath) = @_;
    452453    $self->{_outputPath} = $outputPath if defined($outputPath);
    453 }           
     454}
    454455
    455456###########################################################################
     
    462463    $self->{_dateFormat} = $dateFormat if defined($dateFormat);
    463464    return $self->{_dateFormat};
    464 }       
     465}
    465466
    466467###########################################################################
     
    543544    $title .= " for '$label'\\nFrom '$fromTime' to '$toTime' HST";
    544545
    545     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     546    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    546547    use FileHandle;
    547548    GP->autoflush(1);
     
    612613    $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat);
    613614
    614     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     615    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    615616    use FileHandle;
    616617    GP->autoflush(1);
     
    656657    my $totalPercent = sprintf("%.1f%%", $totalUsed);
    657658
    658     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     659    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    659660    use FileHandle;
    660661    GP->autoflush(1);
     
    672673        "plot '".$tmpFile->filename."' " .
    673674        "using 2:xtic(1) t \"Used\" lt 7," .
    674         "'' using 3 t \"Over $limit% used\" lt 1," . 
    675         "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," . 
    676         "'' using 5 t \"Free\" lt 2," . 
    677         "'' using 6 notitle fs solid 0.50 lt -1" . 
     675        "'' using 3 t \"Over $limit% used\" lt 1," .
     676        "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
     677        "'' using 5 t \"Free\" lt 2," .
     678        "'' using 6 notitle fs solid 0.50 lt -1" .
    678679        ";" .
    679680
     
    718719
    719720
    720     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     721    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    721722    use FileHandle;
    722723    GP->autoflush(1);
     
    731732        set grid
    732733        set size square
    733         set xrange [-0.5:7.5] reverse 
    734         set yrange [-0.5:7.5] 
     734        set xrange [-0.5:7.5] reverse
     735        set yrange [-0.5:7.5]
    735736        unset key
    736737        set palette rgb 22,13,10
     
    769770
    770771    # set up bins
    771     my %histogram; 
     772    my %histogram;
    772773    my @bins;
    773774    my $interval = 0.05;
     
    812813
    813814    my $totalMaskFrac;
    814    
     815
    815816    if ($totalChipCount > 0) {
    816817
     
    842843
    843844    # make histogram
    844     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     845    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    845846    use FileHandle;
    846847    GP->autoflush(1);
     
    859860        "set boxwidth 0.75;" .
    860861        "set xtic rotate by -90 scale 0;" .
    861         "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" . 
     862        "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" .
    862863        "\n";
    863864
     
    865866
    866867    # make cumulative distribution
    867     open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot";
     868    open (GP, "|$GNUPLOT -persist") or die "no gnuplot";
    868869    use FileHandle;
    869870    GP->autoflush(1);
     
    878879        "set ylabel \"Number of Exposures\";" .
    879880        "set xtic rotate by -90 scale 0;" .
    880         "plot " . 
     881        "plot " .
    881882        "'".$tmpFile->filename."' using 1:3 notitle with lines lt 2 lw 2\n";
    882883
Note: See TracChangeset for help on using the changeset viewer.