- Timestamp:
- Jun 6, 2011, 1:56:22 PM (15 years ago)
- Location:
- branches/czw_branch/20110406
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/dist_bundle.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20110406
- Property svn:mergeinfo changed
-
branches/czw_branch/20110406/ippScripts/scripts/dist_bundle.pl
r30922 r31606 62 62 my $streaksrelease = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1); 63 63 my $bgtool = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1); 64 my $staticskytool = can_run('staticskytool') or (warn "Can't find staticskytool" and $missing_tools = 1); 64 65 my $file_cmd = can_run('file') or (warn "can't find program file" and $missing_tools = 1); 65 66 my $zcat = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1); … … 106 107 defined $stage_id and 107 108 defined $component and 108 defined $exp_type and109 109 defined $path_base and 110 110 defined $outroot; 111 111 112 if ($stage eq 'raw' and !$clean and !$no_magic) { 113 114 # for raw stage need to have exposure type defined and if the type is OBJECT we need 115 # a chip_path_base so we can find the chip mask file 116 if (!defined $exp_type or ($exp_type eq 'OBJECT' and !defined $chip_path_base)) { 117 pod2usage( -msg => "Required options: --chip_path_base --exp_type for raw stage", -exitval => 3); 118 } 119 } 120 112 121 $ipprc->redirect_output($logfile) if $logfile; 113 122 114 if ($stage eq 'raw' and !$clean and !$no_magic) {115 # need to be able to find chip mask file116 if ($exp_type eq 'OBJECT' and !defined $chip_path_base) {117 pod2usage( -msg => "Required options: --chip_path_base for raw stage", -exitval => 3);118 }119 }120 121 123 $ipprc->define_camera($camera); 122 124 123 125 $ipprc->outroot_prepare($outroot); 124 126 127 my $num_sky_inputs; 128 if ($stage eq 'sky') { 129 $num_sky_inputs = get_num_sky_inputs($stage_id); 130 } 125 131 # Get the list of data products for this component 126 132 # note: We my_die in get_file_list if something goes wrong. 127 133 128 my $file_list = get_file_list($stage, $component, $path_base, $clean );134 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs); 129 135 130 136 if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) { … … 184 190 # it must exist) 185 191 next if $poor_quality; 192 193 # skip file stats file. Due to a bug the update process destroys them sometimes 194 # XXX: perhaps only do this for stages where we know that this happens 195 next if $file_rule =~ /STATS/; 186 196 187 197 &my_die("failed to resolve $file_name", $component, $PS_EXIT_DATA_ERROR); … … 480 490 my $path_base = shift; 481 491 my $clean = shift; 492 my $num_sky_inputs = shift; 482 493 483 494 my @file_list; … … 531 542 $config_file_rule = "PPSTACK.CONFIG"; 532 543 } elsif ($stage eq "sky") { 533 $config_file_rule = "PSPHOT.STACK.CONFIG"; 544 if ($num_sky_inputs > 1) { 545 $config_file_rule = "PSPHOT.STACK.CONFIG"; 546 } else { 547 $config_file_rule = "PSPHOT.SKY.CONFIG"; 548 } 534 549 } else { 535 550 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 627 642 return \@file_list; 628 643 } 644 sub get_num_sky_inputs { 645 my $sky_id = shift; 646 647 my $command = "$staticskytool -inputs -sky_id $sky_id -simple"; 648 $command .= " -dbname $dbname" if $dbname; 649 $command .= " | wc"; 650 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 651 run(command => $command, verbose => $verbose); 652 unless ($success) { 653 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 654 &my_die("Unable to perform $command: $error_code", $component, $error_code); 655 } 656 my ($num_inputs, $words, $chars) = split " ", (join "", @$stdout_buf); 657 if (!$num_inputs) { 658 $num_inputs = "undefined" if !defined $num_inputs; 659 &my_die("unexpected number of static sky inputs $num_inputs", $PS_EXIT_PROG_ERROR, $component, $error_code); 660 } 661 662 return $num_inputs; 663 } 629 664 630 665 sub my_die
Note:
See TracChangeset
for help on using the changeset viewer.
