Changeset 26447 for trunk/ippScripts/scripts/magic_destreak.pl
- Timestamp:
- Dec 16, 2009, 3:58:23 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_destreak.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak.pl
r25029 r26447 32 32 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 33 33 my $censorObjects = can_run('censorObjects') or (warn "Can't find censorObjects" and $missing_tools = 1); 34 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 34 35 if ($missing_tools) { 35 36 warn("Can't find required tools."); … … 38 39 39 40 # Parse the command-line arguments 40 my ($magic_ds_id, $camera, $streaks, $inv_streaks, $ stage, $stage_id, $component, $uri, $path_base, $cam_path_base);41 my ($magic_ds_id, $camera, $streaks, $inv_streaks, $exp_id, $stage, $stage_id, $component, $uri, $path_base, $cam_path_base); 41 42 my ($outroot, $recoveryroot); 42 43 my ($replace, $release); … … 48 49 'streaks=s' => \$streaks, # file containing the list of streaks 49 50 'inv_streaks=s' => \$inv_streaks,# file containing the list of streaks from the inverse diff 51 'exp_id=s' => \$exp_id, # exp_id, chip_id, warp_id, or diff_id 50 52 'stage=s' => \$stage, # raw, chip, warp, or diff 51 53 'stage_id=s' => \$stage_id, # exp_id, chip_id, warp_id, or diff_id … … 74 76 defined $stage and 75 77 defined $stage_id and 78 defined $exp_id and 76 79 defined $component and 77 80 defined $uri and … … 145 148 } 146 149 } 150 151 my $statsFile = "$outroot/$exp_id.mds.$magic_ds_id.$stage_id.$component.stats"; 147 152 148 153 my $backup_path_base; … … 166 171 if (! -e $recoveryroot ) { 167 172 my $code = system "mkdir -p $recoveryroot"; 168 &my_die("cannot create output directory $ outroot", $magic_ds_id, $component,173 &my_die("cannot create output directory $recoveryroot", $magic_ds_id, $component, 169 174 $code >> 8) if $code; 170 175 } … … 260 265 my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $streaks -image $image"; 261 266 267 $command .= " -stats $statsFile"; 262 268 $command .= " -class_id $class_id" if defined $class_id; 263 269 $command .= " -recovery $recoveryroot" if defined $recoveryroot; … … 288 294 $sources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $path_base); 289 295 296 # Note: we create a stats file for the inverse procesing but we don't look at the results 297 my $invStatsFile = "$outroot/$exp_id.mds.$magic_ds_id.$stage_id.$component.inv.stats"; 298 290 299 my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $streaks -image $image"; 300 $command .= " -stats $invStatsFile"; 291 301 292 302 $command .= " -recovery $recoveryroot" if defined $recoveryroot; … … 371 381 } 372 382 373 # if recovery and/or backup files were expected make sure they exist 383 file_check($statsFile); 384 my $statsFlags; 385 { 386 my $resolvedStatsFile = $ipprc->file_resolve($statsFile); 387 my $command = "$ppStatsFromMetadata $resolvedStatsFile - STREAKSREMOVE"; 388 389 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 390 run(command => $command, verbose => $verbose); 391 unless ($success) { 392 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 393 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $magic_ds_id, $component, $error_code); 394 } 395 foreach my $line (@$stdout_buf) { 396 $statsFlags .= " $line"; 397 } 398 chomp $statsFlags; 399 } 400 401 # XXX: if recovery and/or backup files were expected make sure they exist 374 402 375 403 # Input result into database … … 381 409 $command .= " -backup_path_base $backup_path_base" if $backup_path_base; 382 410 $command .= " -recovery_path_base $recovery_path_base" if $recovery_path_base; 411 $command .= " $statsFlags" if $statsFlags; 383 412 $command .= " -dbname $dbname" if defined $dbname; 384 413
Note:
See TracChangeset
for help on using the changeset viewer.
