IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2011, 4:16:20 PM (15 years ago)
Author:
rhenders
Message:

all time-series plots now created at same time for speed

File:
1 edited

Legend:

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

    r30955 r31886  
    9797    my $type = $isLog ? "log" : "linear";
    9898    return $prefix . "/czarplot_" . $type . "_" . $label . "_" . $stagePart . "_$suffix.png";
    99 }
    100 
    101 ###########################################################################
    102 #
    103 # Plots a time series for all stages for this label, both log and linear
    104 #
    105 ###########################################################################
    106 sub createLogAndLinearTimeSeries {
    107     my ($self, $label, $selectedStage, $beginTime, $endTime) = @_;
    108 
    109     $self->createTimeSeries($label, $selectedStage, $beginTime, $endTime, 1);
    110     $self->createTimeSeries($label, $selectedStage, $beginTime, $endTime, 0);
    11199}
    112100
     
    146134#
    147135###########################################################################
    148 sub createRatePlot {
    149     my ($self, $label, $selectedStage, $beginTime, $endTime, $interval, $histogram, $timeSeries) = @_;
     136sub createRateHistogram {
     137    my ($self, $label, $selectedStage, $beginTime, $endTime, $interval) = @_;
    150138
    151139    # stages
     
    184172    }
    185173
    186     if ($histogram) {
    187 
    188         my $outputFile = createImageFileName($self, $label, $selectedStage, "rh", 0);
    189         $self->plotRateStackedHistogram(\%gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval);
    190     }
    191     if ($timeSeries) {
    192 
    193         my $outputFile = createImageFileName($self, $label, $selectedStage, "rt", 0);
    194         $self->plotTimeSeries(\%gnuplotFiles, $outputFile, $label, $beginTime, $endTime, $maxX, $minX, $timeDiff, "", "Exposures processed per $interval");
    195     }
     174    my $outputFile = createImageFileName($self, $label, $selectedStage, "rh", 0);
     175    $self->plotRateStackedHistogram(\%gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval);
    196176
    197177    # now delete temp dat files
     
    250230###########################################################################
    251231sub createTimeSeries {
    252     my ($self, $label, $selectedStage, $beginTime, $endTime, $isLog, $showCleanup, $deriv) = @_;
     232    my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_;
    253233
    254234    my $minX = 999999999;     
     
    261241    else {$stages = ["$selectedStage"]};       
    262242
    263     my %gnuplotFiles;
     243    my %linDataFiles;
     244    my %logDataFiles;
     245    my %ratDataFiles;
    264246    my $stage = undef;
    265     my $gnuplotFile = undef;
     247    my $linDataFile = undef;
     248    my $logDataFile = undef;
     249    my $ratDataFile = undef;
     250
    266251    foreach $stage (@{$stages}) {
    267252
     
    274259                    \$maxX,
    275260                    \$timeDiff,
    276                     \$gnuplotFile,
    277                     $isLog,
    278                     $showCleanup,
    279                     $deriv)) {
    280 
    281             $gnuplotFiles{$stage} = $gnuplotFile;
     261                    \$linDataFile,
     262                    \$logDataFile,
     263                    \$ratDataFile)) {
     264
     265            $linDataFiles{$stage} = $linDataFile;
     266            $logDataFiles{$stage} = $logDataFile;
     267            $ratDataFiles{$stage} = $ratDataFile;
    282268        }
    283269    }                                                           
    284270
    285     my $numOfPlots =  keys(%gnuplotFiles);
     271    my $numOfPlots =  keys(%linDataFiles);
    286272
    287273    if ($numOfPlots == 0 ) {
     
    297283    }
    298284
    299     my $outputFile = createImageFileName($self, $label, $selectedStage, "t", $isLog);
    300     my $yTitle;
    301     if ($isLog) {$yTitle = "Log(Exposures)";}
    302     elsif ($deriv) {$yTitle = "dExposures/dTime(secs)";}
    303     else {$yTitle = "Exposures";}
    304     $self->plotTimeSeries(
    305             \%gnuplotFiles,
    306             $outputFile,
    307             $label,
    308             $beginTime,
    309             $endTime,
    310             $maxX,
    311             $minX,
    312             $timeDiff,
    313             "",
    314             $yTitle);
    315 }                                                   
     285    if ($linear) {
     286
     287        my $outputFile = createImageFileName($self, $label, $selectedStage, "t", 0);
     288
     289        $self->plotTimeSeries(
     290                \%linDataFiles,
     291                $outputFile,
     292                $label,
     293                $beginTime,
     294                $endTime,
     295                $maxX,
     296                $minX,
     297                $timeDiff,
     298                "",
     299                "Exposures");
     300    }
     301
     302    if ($log) {
     303
     304        my $outputFile = createImageFileName($self, $label, $selectedStage, "t", 1);
     305
     306        $self->plotTimeSeries(
     307                \%logDataFiles,
     308                $outputFile,
     309                $label,
     310                $beginTime,
     311                $endTime,
     312                $maxX,
     313                $minX,
     314                $timeDiff,
     315                "",
     316                "Log(Exposures)");
     317    }
     318
     319    if ($rate) {
     320
     321        my $outputFile = createImageFileName($self, $label, $selectedStage, "rt", 0);
     322
     323        $self->plotTimeSeries(
     324                \%ratDataFiles,
     325                $outputFile,
     326                $label,
     327                $beginTime,
     328                $endTime,
     329                $maxX,
     330                $minX,
     331                $timeDiff,
     332                "",
     333                "Exposures processed per hour");
     334}   
     335}                                               
    316336
    317337###########################################################################
     
    468488    my $timeFormat = undef;
    469489    my $divX = undef;
    470     #my $yTitle = undef;
    471     #if ($isLog) {$yTitle = "Log( Exposures )";}
    472     #elsif ($isDeriv) {$yTitle = "dExposures/dTime(secs)";}
    473     #else {$yTitle = "Exposures";}
    474490
    475491    $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat);
     
    478494
    479495    # sort out plot title
    480     #my $title = "";
    481     #if ($isDeriv) {$title .= "First derivatives of "}
    482496    if ($numOfPlots == 1) {foreach my $stage (keys %$gnuplotFiles) {$title .= "'".$stage."'";}}
    483497    else {$title .= "'all stages'"}
Note: See TracChangeset for help on using the changeset viewer.