IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36047


Ignore:
Timestamp:
Aug 27, 2013, 2:40:35 PM (13 years ago)
Author:
bills
Message:

support building stack_summary stage bundles (right now just used by pstamp)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_bundle.pl

    r35957 r36047  
    5353                      'PPSTACK.OUTPUT.MASK' => 'mask',
    5454                      'PPSTACK.OUTPUT.VARIANCE' => 'variance' );
    55 my %sky_cleaned   = ();
    56 my %skycal_cleaned = ();
     55my %empty_cleaned = ();
    5756
    5857
     
    135134my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
    136135
    137 if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {
     136if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) {
    138137    # If the file list is empty it is an error because we should at least get a config dump file
    139138    # except for fake stage which doesn't do anything yet
     
    461460    } elsif ($stage eq "stack") {
    462461        $type = $stack_cleaned{$rule};
    463     } elsif ($stage eq "sky") {
    464         $type = $sky_cleaned{$rule};
    465     } elsif ($stage eq "skycal") {
    466         $type = $skycal_cleaned{$rule};
     462    } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary') {
     463        $type = $empty_cleaned{$rule};
    467464    } else {
    468465        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    552549    } elsif ($stage eq "skycal") {
    553550        $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);
    554554    } else {
    555555        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    666666    if (!$num_inputs) {
    667667        $num_inputs = "undefined" if !defined $num_inputs;
    668         &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);
    669669    }
    670670
    671671    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.
     676sub 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;
    672706}
    673707
Note: See TracChangeset for help on using the changeset viewer.