Changeset 25016
- Timestamp:
- Aug 7, 2009, 10:54:46 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_destreak.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak.pl
r25005 r25016 38 38 39 39 # Parse the command-line arguments 40 my ($magic_ds_id, $camera, $streaks, $ stage, $stage_id, $component, $uri, $path_base, $inverse, $cam_path_base);40 my ($magic_ds_id, $camera, $streaks, $inv_streaks, $stage, $stage_id, $component, $uri, $path_base, $cam_path_base); 41 41 my ($outroot, $recoveryroot); 42 42 my ($replace, $release); … … 47 47 'camera=s' => \$camera, # camera for evaluating file rules 48 48 'streaks=s' => \$streaks, # file containing the list of streaks 49 'inv_streaks=s' => \$inv_streaks,# file containing the list of streaks from the inverse diff 49 50 'stage=s' => \$stage, # raw, chip, warp, or diff 50 51 'stage_id=s' => \$stage_id, # exp_id, chip_id, warp_id, or diff_id … … 52 53 'uri=s' => \$uri, # uri of the input image 53 54 'path_base=s' => \$path_base, # path_base of the input 54 'inverse' => \$inverse, # Inverse subtraction?55 55 'cam_path_base=s'=> \$cam_path_base, # path_base from camera stage (for chip and raw) 56 56 'outroot=s' => \$outroot, # "directory" for temporary images (may be nebulous) … … 94 94 } elsif ($stage ne "camera") { 95 95 &my_die("Invalid value for stage: $stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR); 96 } 96 } 97 $inv_streaks = undef if defined($inv_streaks) and ($inv_streaks eq "NULL"); 97 98 98 99 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 234 235 $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $path_base); 235 236 } elsif ($stage eq "diff") { 236 my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images 237 $image = $ipprc->filename($name, $path_base); 238 $mask = $ipprc->filename("$name.MASK", $path_base); 239 $weight = $ipprc->filename("$name.VARIANCE", $path_base); 240 $sources = $ipprc->filename("$name.SOURCES", $path_base); 237 $image = $ipprc->filename("PPSUB.OUTPUT", $path_base); 238 $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base); 239 $weight = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $path_base); 240 $sources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base); 241 241 } 242 242 … … 266 266 } 267 267 } 268 if (($stage eq "diff") and $inv_streaks) { 269 $image = $ipprc->filename("PPSUB.INVERSE", $path_base); 270 $mask = $ipprc->filename("PPSUB.INVERSE.MASK", $path_base); 271 $weight = $ipprc->filename("PPSUB.INVERSE.VARIANCE", $path_base); 272 $sources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $path_base); 273 274 my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $inv_streaks -image $image"; 275 276 $command .= " -recovery $recoveryroot" if defined $recoveryroot; 277 $command .= " -mask $mask" if defined $mask; 278 $command .= " -weight $weight" if defined $weight; 279 $command .= " -sources $sources" if defined $sources; 280 $command .= " -replace" if $replace; 281 $command .= " -release" if $release; 282 $command .= " -dbname $dbname" if defined $dbname; 283 unless (defined $no_op) { 284 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 285 run(command => $command, verbose => $verbose); 286 unless ($success) { 287 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 288 &my_die("Unable to perform streaksremove: $error_code", $magic_ds_id, $component, $error_code); 289 } 290 } else { 291 print "skipping command $command\n"; 292 } 293 } 268 294 } else { 269 295 # camera stage. The only work to do is to censor the detections file
Note:
See TracChangeset
for help on using the changeset viewer.
