- Timestamp:
- Aug 30, 2013, 4:52:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/ippScripts/scripts/dist_bundle.pl
r35117 r36072 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 my %empty_cleaned = (); 58 56 59 57 … … 110 108 defined $outroot; 111 109 110 $no_magic = 1; 111 112 112 if ($stage eq 'raw' and !$clean and !$no_magic) { 113 113 … … 134 134 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs); 135 135 136 if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {136 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { 137 137 # If the file list is empty it is an error because we should at least get a config dump file 138 138 # except for fake stage which doesn't do anything yet … … 460 460 } elsif ($stage eq "stack") { 461 461 $type = $stack_cleaned{$rule}; 462 } elsif ($stage eq "sky" ) {463 $type = $ sky_cleaned{$rule};462 } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary') { 463 $type = $empty_cleaned{$rule}; 464 464 } else { 465 465 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 546 546 $config_file_rule = "PPSTACK.CONFIG"; 547 547 } elsif ($stage eq "sky") { 548 if (1 or $num_sky_inputs > 1) { 549 $config_file_rule = "PSPHOT.STACK.CONFIG"; 550 } else { 551 $config_file_rule = "PSPHOT.SKY.CONFIG"; 552 } 548 $config_file_rule = "PSPHOT.STACK.CONFIG"; 549 } elsif ($stage eq "skycal") { 550 $config_file_rule = "PSASTRO.CONFIG"; 551 } elsif ($stage eq "stack_summary") { 552 # stack_summary stage does not use a config dump file. 553 return build_stack_summary_file_list($path_base, \@file_list); 553 554 } else { 554 555 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 665 666 if (!$num_inputs) { 666 667 $num_inputs = "undefined" if !defined $num_inputs; 667 &my_die("unexpected number of static sky inputs $num_inputs", $ PS_EXIT_PROG_ERROR, $component, $error_code);668 &my_die("unexpected number of static sky inputs $num_inputs", $component, $error_code); 668 669 } 669 670 670 671 return $num_inputs; 672 } 673 674 # For stack_summary stage, we don't have a config dump file to give us the list of files. 675 # For now run neb-ls on the path base and take everything that matches. 676 sub build_stack_summary_file_list { 677 my ($path_base, $file_list) = @_; 678 679 my $scheme = file_scheme($path_base); 680 681 if (!$scheme or $scheme ne 'neb') { 682 &my_die("Building bundles for stack_summary not supported for no nebulous path_base.", 683 $component, $PS_EXIT_PROG_ERROR); 684 } 685 686 my $command = "neb-ls $path_base" . '%'; 687 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 688 run(command => $command, verbose => $verbose); 689 unless ($success) { 690 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 691 &my_die("Unable to perform $command: $error_code", $component, $error_code); 692 } 693 my $nebls_output = join "", @$stdout_buf; 694 695 my @files = split "\n", $nebls_output; 696 697 my $i = 0; 698 foreach my $f (@files) { 699 my %file; 700 $file{file_rule} = sprintf 'RULE.%d', $i++; 701 $file{name} = 'neb://any/' . $f; 702 push @$file_list, \%file; 703 } 704 705 return $file_list; 671 706 } 672 707
Note:
See TracChangeset
for help on using the changeset viewer.
