- Timestamp:
- Apr 21, 2014, 5:42:34 AM (12 years ago)
- Location:
- branches/eam_branches/ps2-tc3-20130727
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/dist_bundle.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ps2-tc3-20130727
- Property svn:mergeinfo changed
-
branches/eam_branches/ps2-tc3-20130727/ippScripts/scripts/dist_bundle.pl
r35117 r36680 50 50 'PPSUB.INVERSE.MASK' => 'inv_mask', 51 51 'PPSUB.INVERSE.VARIANCE' => 'inv_variance' ); 52 my %stack_cleaned = ( 'PPSTACK.OUTPUT' => 'image', 52 53 my %stack_cleaned = ( 'PPSTACK.UNCONV' => 'image', 54 'PPSTACK.UNCONV.MASK' => 'mask', 55 'PPSTACK.UNCONV.VARIANCE' => 'variance', 56 'PPSTACK.UNCONV.EXP' => 'exp', 57 'PPSTACK.UNCONV.EXPNUM' => 'expnum', 58 'PPSTACK.UNCONV.EXPWT' => 'expwt' 59 ); 60 61 my %stack_convolved = ( 'PPSTACK.OUTPUT' => 'image', 53 62 'PPSTACK.OUTPUT.MASK' => 'mask', 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' ); 63 'PPSTACK.OUTPUT.VARIANCE' => 'variance', 64 'PPSTACK.OUTPUT.EXP' => 'exp', 65 'PPSTACK.OUTPUT.EXPNUM' => 'expnum', 66 'PPSTACK.OUTPUT.EXPWT' => 'expwt' 67 ); 68 my %empty_cleaned = (); 69 58 70 59 71 … … 110 122 defined $outroot; 111 123 124 $no_magic = 1; 125 112 126 if ($stage eq 'raw' and !$clean and !$no_magic) { 113 127 … … 134 148 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs); 135 149 136 if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {150 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { 137 151 # If the file list is empty it is an error because we should at least get a config dump file 138 # except for fake stage which doesn't do anything yet 152 # except for fake stage which doesn't do anything yet, stack_summary stage, and of course raw files have 153 # no config dump because they aren't processed 139 154 &my_die("empty file list", $component, $PS_EXIT_CONFIG_ERROR) if (!scalar @$file_list); 140 155 } … … 165 180 my $image_type = get_image_type($stage, $file_rule); 166 181 182 # skip useless empty trace files 183 next if ($file_rule =~ /TRACE/); 184 167 185 # if this is an image and we are building a clean bundle or if quality is bad skip this rule 168 186 next if $image_type and ($clean or $poor_quality); 187 188 if ($stage eq 'stack') { 189 # skip convolved stacks since they are deleted just after they are created now 190 next if $stack_convolved{$file_rule}; 191 } 169 192 170 193 # if magic is required, don't ship jpegs or binned fits images … … 180 203 181 204 my $file_name = $file->{name}; 182 my $base = basename($file_name);183 205 my $path = $ipprc->file_resolve($file_name); 206 207 if (!$path and $file_rule =~ /LOG/) { 208 my $compressed_file_name = $file_name . '.bz2'; 209 my $compressed_path = $ipprc->file_resolve($compressed_file_name); 210 if ($compressed_path) { 211 $path = $compressed_path; 212 $file_name = $compressed_file_name; 213 } 214 } 215 184 216 185 217 if (!$path) { … … 194 226 # XXX: perhaps only do this for stages where we know that this happens 195 227 next if $file_rule =~ /STATS/; 196 # don't fail on these "non-essential files" 228 # don't fail if these "non-essential files" are missing 229 next if $file_rule =~ /LOG/; 197 230 next if $file_rule =~ /TRACE/; 198 next if $file_rule =~ /LOG/;199 231 next if $file_rule =~ /BIN/; 232 233 # chip stage cmf files are not regenerated after cleanup so don't complain if 234 # they are missing. They are of limited utility anyways. USE the smfs 235 next if ($stage eq 'chip' and $file_rule eq 'PSPHOT.OUTPUT'); 200 236 201 237 &my_die("failed to resolve $file_name", $component, $PS_EXIT_DATA_ERROR); … … 232 268 # create a symbolic link from the file in the nebulous repository 233 269 # in the temporary directory 234 symlink $path, "$tmpdir/ $base";270 symlink $path, "$tmpdir/" . basename($file_name); 235 271 } 236 272 } … … 460 496 } elsif ($stage eq "stack") { 461 497 $type = $stack_cleaned{$rule}; 462 } elsif ($stage eq "sky" ) {463 $type = $ sky_cleaned{$rule};498 } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary' or $stage eq 'ff') { 499 $type = $empty_cleaned{$rule}; 464 500 } else { 465 501 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 546 582 $config_file_rule = "PPSTACK.CONFIG"; 547 583 } elsif ($stage eq "sky") { 548 if (1 or $num_sky_inputs > 1) { 549 $config_file_rule = "PSPHOT.STACK.CONFIG"; 584 $config_file_rule = "PSPHOT.STACK.CONFIG"; 585 } elsif ($stage eq "skycal") { 586 $config_file_rule = "PSASTRO.CONFIG"; 587 } elsif ($stage eq "stack_summary") { 588 # stack_summary stage does not use a config dump file. 589 return build_stack_summary_file_list($path_base, \@file_list); 590 } elsif ($stage eq "ff") { 591 if ($component eq 'summary') { 592 # full force summary does not use a config dump file. Cobble together a file list 593 return build_ff_summary_file_list($path_base, \@file_list); 550 594 } else { 551 595 $config_file_rule = "PSPHOT.SKY.CONFIG"; … … 665 709 if (!$num_inputs) { 666 710 $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);711 &my_die("unexpected number of static sky inputs $num_inputs", $component, $error_code); 668 712 } 669 713 670 714 return $num_inputs; 715 } 716 717 # For stack_summary stage, we don't have a config dump file to give us the list of files. 718 # For now run neb-ls on the path base and take everything that matches. 719 sub build_stack_summary_file_list { 720 my ($path_base, $file_list) = @_; 721 722 my $scheme = file_scheme($path_base); 723 724 if (!$scheme or $scheme ne 'neb') { 725 &my_die("Building bundles for stack_summary not supported for no nebulous path_base.", 726 $component, $PS_EXIT_PROG_ERROR); 727 } 728 729 my $command = "neb-ls $path_base" . '%'; 730 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 731 run(command => $command, verbose => $verbose); 732 unless ($success) { 733 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 734 &my_die("Unable to perform $command: $error_code", $component, $error_code); 735 } 736 my $nebls_output = join "", @$stdout_buf; 737 738 my @files = split "\n", $nebls_output; 739 740 my $i = 0; 741 foreach my $f (@files) { 742 my %file; 743 $file{file_rule} = sprintf 'RULE.%d', $i++; 744 $file{name} = 'neb://any/' . $f; 745 push @$file_list, \%file; 746 } 747 748 return $file_list; 749 } 750 751 # psphotFullForceSummary does not produce a config dump file cobble together a file list 752 sub build_ff_summary_file_list { 753 my ($path_base, $file_list) = @_; 754 755 my %cmf ; 756 $cmf{file_rule} = "SOURCES"; 757 $cmf{name} = "$path_base.cmf"; 758 push @$file_list, \%cmf; 759 760 my %log; 761 $log{file_rule} = "LOG"; 762 $log{name} = "$path_base.log"; 763 push @$file_list, \%log; 764 765 return $file_list; 671 766 } 672 767
Note:
See TracChangeset
for help on using the changeset viewer.
