Changeset 27946 for trunk/ippScripts/scripts/magic_destreak_revert.pl
- Timestamp:
- May 13, 2010, 10:56:50 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_destreak_revert.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak_revert.pl
r27718 r27946 38 38 39 39 # Parse the command-line arguments 40 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction );40 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction, $magicked); 41 41 my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum); 42 42 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile); … … 55 55 'replace=s' => \$replace, # replace the input images with the results. 56 56 'bothways=s' => \$bothways, # run has inverse files (bothways diff) 57 'magicked=s' => \$magicked, # magicked state of the run 57 58 'save-temps' => \$save_temps, # Save temporary files? 58 59 'dbname=s' => \$dbname, # Database name … … 64 65 65 66 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 66 pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot ",67 pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot --magicked", 67 68 -exitval => 3) unless 68 69 defined $magic_ds_id and … … 72 73 defined $component and 73 74 defined $path_base and 75 defined $magicked and 74 76 defined $outroot; 75 77 … … 77 79 78 80 &my_die("cam_path_base is required for chip stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'chip' and !$cam_path_base); 81 82 79 83 80 84 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 169 173 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 170 174 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 171 run(command => $command, verbose => $verbose); 175 # note verbose == 0 to keep from polluting log file with lots of usually useless information 176 run(command => $command, verbose => 0); 172 177 unless ($success) { 173 178 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 182 187 } 183 188 189 $image = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id); 190 $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id); 191 184 192 # we use the mask output from the camera stage for input and replace 185 193 # the output of the chip stage with that mask as well. 186 $image = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id); 187 $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id); 188 189 if ($dynamicMasks) { 194 # Note that when destreaking as part of an update $magicked is non-zero. 195 # In this case we do not touch the camera stage mask so there is no need to revert it 196 if (!$magicked and $dynamicMasks) { 190 197 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 191 198 $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id); … … 195 202 196 203 $bimage = $ipprc->filename("PPIMAGE.CHIP", $backup_path_base, $class_id); 197 # This is kludgey but correct204 # This is somewhat kludgey but it works whether the mask is camera mask or chip mask 198 205 $bmask = dirname($backup_path_base) . "/SR_" . basename($mask); 199 206 $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
Note:
See TracChangeset
for help on using the changeset viewer.
