- Timestamp:
- Aug 19, 2010, 6:52:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/ippScripts/scripts/dist_bundle.pl
r28794 r28981 53 53 'PPSTACK.OUTPUT.MASK' => 'mask', 54 54 'PPSTACK.OUTPUT.VARIANCE' => 'variance' ); 55 my %sky_cleaned = ( 'PSPHOT.STACK.OUTPUT.IMAGE' => 'image', 56 'PSPHOT.STACK.OUTPUT.MASK' => 'mask', 57 'PSPHOT.STACK.OUTPUT.VARIANCE' => 'variance' ); 55 58 56 59 … … 58 61 my $missing_tools; 59 62 my $streaksrelease = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1); 63 my $bgtool = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1); 60 64 if ($missing_tools) { 61 65 warn("Can't find required tools."); … … 224 228 } 225 229 230 if (!$clean) { 231 if ($stage eq 'chip_bg') { 232 # add the variance file from the original chipRun 233 my $command = "$bgtool -listchip -chip_bg_id $stage_id -class_id $component"; 234 $command .= " -dbname $dbname" if $dbname; 235 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 236 run(command => $command, verbose => $verbose); 237 unless ($success) { 238 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 239 &my_die("Unable to perform $command: $error_code", $component, $error_code); 240 } 241 my $mdcParser = PS::IPP::Metadata::Config->new; 242 my $list = $mdcParser->parse( join "", @$stdout_buf) or 243 &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR); 244 my $parsed = parse_md_list($list); 245 246 # result is an array with one element 247 my $chip_data = $parsed->[0]; 248 249 my $chip_path_base = $chip_data->{path_base}; 250 $variance = $ipprc->filename('PPIMAGE.CHIP.VARIANCE', $chip_path_base, $component) or 251 &my_die("Unable to resolve variance file name from $chip_path_base", $component, $PS_EXIT_SYS_ERROR); 252 253 } elsif ($stage eq 'warp_bg') { 254 # add the variance file from the original warpRun 255 my $command = "$bgtool -listwarp -warp_bg_id $stage_id -skycell_id $component"; 256 $command .= " -dbname $dbname" if $dbname; 257 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 258 run(command => $command, verbose => $verbose); 259 unless ($success) { 260 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 261 &my_die("Unable to perform $command: $error_code", $component, $error_code); 262 } 263 my $mdcParser = PS::IPP::Metadata::Config->new; 264 my $list = $mdcParser->parse( join "", @$stdout_buf) or 265 &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR); 266 my $parsed = parse_md_list($list); 267 my $warp_data = $parsed->[0]; 268 my $warp_path_base = $warp_data->{path_base}; 269 $variance = $ipprc->filename('PSWARP.OUTPUT.VARIANCE', $warp_path_base) or 270 &my_die("Unable to resolve variance file name from $warp_path_base", $component, $PS_EXIT_SYS_ERROR); 271 } 272 } 273 226 274 if ($nan_masked_pixels) { 227 275 # One last check as to whether magic has been applied to the inputs … … 239 287 if (($stage ne "chip_bg") and ($stage ne "warp_bg")) { 240 288 &my_die("no variance image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$variance; 289 } else { 290 &my_die("variance is not defined", $component, $PS_EXIT_CONFIG_ERROR) if !$variance; 241 291 } 242 292 } … … 373 423 } elsif ($stage eq "stack") { 374 424 $type = $stack_cleaned{$rule}; 425 } elsif ($stage eq "sky") { 426 $type = $sky_cleaned{$rule}; 375 427 } else { 376 428 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 453 505 } elsif ($stage eq "stack") { 454 506 $config_file_rule = "PPSTACK.CONFIG"; 507 } elsif ($stage eq "sky") { 508 $config_file_rule = "PSPHOT.STACK.CONFIG"; 455 509 } else { 456 510 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
Note:
See TracChangeset
for help on using the changeset viewer.
