IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 30, 2013, 4:52:14 PM (13 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/dist_bundle.pl

    r35117 r36072  
    5353                      'PPSTACK.OUTPUT.MASK' => 'mask',
    5454                      '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' );
     55my %empty_cleaned = ();
    5856
    5957
     
    110108    defined $outroot;
    111109
     110$no_magic = 1;
     111
    112112if ($stage eq 'raw' and !$clean and !$no_magic) {
    113113   
     
    134134my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
    135135
    136 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) {
    137137    # If the file list is empty it is an error because we should at least get a config dump file
    138138    # except for fake stage which doesn't do anything yet
     
    460460    } elsif ($stage eq "stack") {
    461461        $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};
    464464    } else {
    465465        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    546546        $config_file_rule = "PPSTACK.CONFIG";
    547547    } 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);
    553554    } else {
    554555        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    665666    if (!$num_inputs) {
    666667        $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);
    668669    }
    669670
    670671    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;
    671706}
    672707
Note: See TracChangeset for help on using the changeset viewer.