Changeset 31886 for trunk/tools/czartool/Plotter.pm
- Timestamp:
- Jul 15, 2011, 4:16:20 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool/Plotter.pm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/Plotter.pm
r30955 r31886 97 97 my $type = $isLog ? "log" : "linear"; 98 98 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 linear104 #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);111 99 } 112 100 … … 146 134 # 147 135 ########################################################################### 148 sub createRate Plot{149 my ($self, $label, $selectedStage, $beginTime, $endTime, $interval , $histogram, $timeSeries) = @_;136 sub createRateHistogram { 137 my ($self, $label, $selectedStage, $beginTime, $endTime, $interval) = @_; 150 138 151 139 # stages … … 184 172 } 185 173 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); 196 176 197 177 # now delete temp dat files … … 250 230 ########################################################################### 251 231 sub createTimeSeries { 252 my ($self, $label, $selectedStage, $beginTime, $endTime, $ isLog, $showCleanup, $deriv) = @_;232 my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_; 253 233 254 234 my $minX = 999999999; … … 261 241 else {$stages = ["$selectedStage"]}; 262 242 263 my %gnuplotFiles; 243 my %linDataFiles; 244 my %logDataFiles; 245 my %ratDataFiles; 264 246 my $stage = undef; 265 my $gnuplotFile = undef; 247 my $linDataFile = undef; 248 my $logDataFile = undef; 249 my $ratDataFile = undef; 250 266 251 foreach $stage (@{$stages}) { 267 252 … … 274 259 \$maxX, 275 260 \$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; 282 268 } 283 269 } 284 270 285 my $numOfPlots = keys(% gnuplotFiles);271 my $numOfPlots = keys(%linDataFiles); 286 272 287 273 if ($numOfPlots == 0 ) { … … 297 283 } 298 284 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 } 316 336 317 337 ########################################################################### … … 468 488 my $timeFormat = undef; 469 489 my $divX = undef; 470 #my $yTitle = undef;471 #if ($isLog) {$yTitle = "Log( Exposures )";}472 #elsif ($isDeriv) {$yTitle = "dExposures/dTime(secs)";}473 #else {$yTitle = "Exposures";}474 490 475 491 $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat); … … 478 494 479 495 # sort out plot title 480 #my $title = "";481 #if ($isDeriv) {$title .= "First derivatives of "}482 496 if ($numOfPlots == 1) {foreach my $stage (keys %$gnuplotFiles) {$title .= "'".$stage."'";}} 483 497 else {$title .= "'all stages'"}
Note:
See TracChangeset
for help on using the changeset viewer.
