Changeset 36458
- Timestamp:
- Jan 21, 2014, 10:29:30 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/ippScripts/scripts/dist_bundle.pl
- Property svn:mergeinfo set to
r36224 r36458 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/; 200 232 201 # don't fail if cmf file is missing they are not regenerated on update 202 next if ($stage eq 'chip' and $file_rule eq 'PSPHOT.OUTPUT'); 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'); 203 236 204 237 &my_die("failed to resolve $file_name", $component, $PS_EXIT_DATA_ERROR); … … 235 268 # create a symbolic link from the file in the nebulous repository 236 269 # in the temporary directory 237 symlink $path, "$tmpdir/ $base";270 symlink $path, "$tmpdir/" . basename($file_name); 238 271 } 239 272 } … … 463 496 } elsif ($stage eq "stack") { 464 497 $type = $stack_cleaned{$rule}; 465 } elsif ($stage eq "sky" ) {466 $type = $ sky_cleaned{$rule};498 } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary') { 499 $type = $empty_cleaned{$rule}; 467 500 } else { 468 501 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 549 582 $config_file_rule = "PPSTACK.CONFIG"; 550 583 } elsif ($stage eq "sky") { 551 if (1 or $num_sky_inputs > 1) { 552 $config_file_rule = "PSPHOT.STACK.CONFIG"; 553 } else { 554 $config_file_rule = "PSPHOT.SKY.CONFIG"; 555 } 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); 556 590 } else { 557 591 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 668 702 if (!$num_inputs) { 669 703 $num_inputs = "undefined" if !defined $num_inputs; 670 &my_die("unexpected number of static sky inputs $num_inputs", $ PS_EXIT_PROG_ERROR, $component, $error_code);704 &my_die("unexpected number of static sky inputs $num_inputs", $component, $error_code); 671 705 } 672 706 673 707 return $num_inputs; 708 } 709 710 # For stack_summary stage, we don't have a config dump file to give us the list of files. 711 # For now run neb-ls on the path base and take everything that matches. 712 sub build_stack_summary_file_list { 713 my ($path_base, $file_list) = @_; 714 715 my $scheme = file_scheme($path_base); 716 717 if (!$scheme or $scheme ne 'neb') { 718 &my_die("Building bundles for stack_summary not supported for no nebulous path_base.", 719 $component, $PS_EXIT_PROG_ERROR); 720 } 721 722 my $command = "neb-ls $path_base" . '%'; 723 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 724 run(command => $command, verbose => $verbose); 725 unless ($success) { 726 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 727 &my_die("Unable to perform $command: $error_code", $component, $error_code); 728 } 729 my $nebls_output = join "", @$stdout_buf; 730 731 my @files = split "\n", $nebls_output; 732 733 my $i = 0; 734 foreach my $f (@files) { 735 my %file; 736 $file{file_rule} = sprintf 'RULE.%d', $i++; 737 $file{name} = 'neb://any/' . $f; 738 push @$file_list, \%file; 739 } 740 741 return $file_list; 674 742 } 675 743
Note:
See TracChangeset
for help on using the changeset viewer.
