- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ippScripts/scripts/magic_destreak.pl
r23352 r24244 35 35 36 36 # Parse the command-line arguments 37 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $ cam_path_base);37 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $inverse, $cam_path_base); 38 38 my ($outroot, $recoveryroot); 39 39 my ($replace, $remove, $release); … … 49 49 'uri=s' => \$uri, # uri of the input image 50 50 'path_base=s' => \$path_base, # path_base of the input 51 'inverse' => \$inverse, # Inverse subtraction? 51 52 'cam_path_base=s'=> \$cam_path_base, # path_base of the associated camera run 52 53 'outroot=s' => \$outroot, # "directory" for temporary images (may be nebulous) … … 64 65 65 66 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 66 pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component -- outroot",67 pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot", 67 68 -exitval => 3) unless 68 69 defined $magic_ds_id and … … 72 73 defined $stage_id and 73 74 defined $component and 75 defined $uri and 76 defined $path_base and 74 77 defined $outroot; 75 78 … … 104 107 } 105 108 109 # default value is "NULL" do not use 110 if (defined($recoveryroot) and ($recoveryroot = "NULL")) { 111 $recoveryroot = undef; 112 } 113 106 114 if (($stage eq "raw") and $replace and ! $recoveryroot) { 107 115 &my_die("Can not replace raw files without defining recoveryroot.", … … 168 176 169 177 foreach my $skycell (@$skycells) { 170 print $sfh "$skycell->{uri}\n" 178 my $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base}); 179 print $sfh "$skycell_uri\n"; 171 180 } 172 181 close $sfh; … … 174 183 } 175 184 176 my $image = $uri; 177 178 my ($mask, $ch_mask, $weight, $astrom); 185 my ($image, $mask, $ch_mask, $weight, $astrom); 179 186 180 187 if ($stage eq "raw") { 188 $image = $uri; 181 189 $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base); 182 190 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id) if $release ; … … 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. 194 $image = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id); 186 195 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 187 196 $ch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id); … … 189 198 $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base); 190 199 } elsif ($stage eq "warp") { 200 $image = $ipprc->filename("PSWARP.OUTPUT", $path_base); 191 201 $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base); 192 202 $weight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $path_base); 193 203 } elsif ($stage eq "diff") { 194 $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base); 195 $weight = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $path_base); 204 my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images 205 $image = $ipprc->filename($name, $path_base); 206 $mask = $ipprc->filename("$name.MASK", $path_base); 207 $weight = $ipprc->filename("$name.VARIANCE", $path_base); 196 208 } 197 209 … … 272 284 $command .= " -magic_ds_id $magic_ds_id"; 273 285 $command .= " -component $component"; 274 $command .= " - code$exit_code";286 $command .= " -fault $exit_code"; 275 287 $command .= " -dbname $dbname" if defined $dbname; 276 288
Note:
See TracChangeset
for help on using the changeset viewer.
