Changeset 28942 for trunk/ippScripts/scripts/dist_bundle.pl
- Timestamp:
- Aug 17, 2010, 12:04:36 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/dist_bundle.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/dist_bundle.pl
r28753 r28942 58 58 my $missing_tools; 59 59 my $streaksrelease = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1); 60 my $bgtool = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1); 60 61 if ($missing_tools) { 61 62 warn("Can't find required tools."); … … 224 225 } 225 226 227 if (!$clean) { 228 if ($stage eq 'chip_bg') { 229 # add the variance file from the original chipRun 230 my $command = "$bgtool -listchip -chip_bg_id $stage_id -class_id $component"; 231 $command .= " -dbname $dbname" if $dbname; 232 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 233 run(command => $command, verbose => $verbose); 234 unless ($success) { 235 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 236 &my_die("Unable to perform $command: $error_code", $component, $error_code); 237 } 238 my $mdcParser = PS::IPP::Metadata::Config->new; 239 my $list = $mdcParser->parse( join "", @$stdout_buf) or 240 &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR); 241 my $parsed = parse_md_list($list); 242 243 # result is an array with one element 244 my $chip_data = $parsed->[0]; 245 246 my $chip_path_base = $chip_data->{path_base}; 247 $variance = $ipprc->filename('PPIMAGE.CHIP.VARIANCE', $chip_path_base, $component) or 248 &my_die("Unable to resolve variance file name from $chip_path_base", $component, $PS_EXIT_SYS_ERROR); 249 250 } elsif ($stage eq 'warp_bg') { 251 # add the variance file from the original warpRun 252 my $command = "$bgtool -listwarp -warp_bg_id $stage_id -skycell_id $component"; 253 $command .= " -dbname $dbname" if $dbname; 254 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 255 run(command => $command, verbose => $verbose); 256 unless ($success) { 257 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 258 &my_die("Unable to perform $command: $error_code", $component, $error_code); 259 } 260 my $mdcParser = PS::IPP::Metadata::Config->new; 261 my $list = $mdcParser->parse( join "", @$stdout_buf) or 262 &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR); 263 my $parsed = parse_md_list($list); 264 my $warp_data = $parsed->[0]; 265 my $warp_path_base = $warp_data->{path_base}; 266 $variance = $ipprc->filename('PSWARP.OUTPUT.VARIANCE', $warp_path_base) or 267 &my_die("Unable to resolve variance file name from $warp_path_base", $component, $PS_EXIT_SYS_ERROR); 268 } 269 } 270 226 271 if ($nan_masked_pixels) { 227 272 # One last check as to whether magic has been applied to the inputs … … 239 284 if (($stage ne "chip_bg") and ($stage ne "warp_bg")) { 240 285 &my_die("no variance image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$variance; 286 } else { 287 &my_die("variance is not defined", $component, $PS_EXIT_CONFIG_ERROR) if !$variance; 241 288 } 242 289 }
Note:
See TracChangeset
for help on using the changeset viewer.
