IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31566


Ignore:
Timestamp:
May 24, 2011, 2:50:22 PM (15 years ago)
Author:
bills
Message:

fixes to staticsky stage bundling

Location:
tags/ipp-20110505/ippScripts/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110505/ippScripts/scripts/dist_advancerun.pl

    r30489 r31566  
    114114    $tool_cmd = "$staticskytool -sky_id";
    115115    $list_mode = "-result";
    116     $component_key = "";
     116    $component_key = "skycell_id";
    117117} elsif ($stage eq "diff") {
    118118    $tool_cmd = "$difftool -diff_id";
  • tags/ipp-20110505/ippScripts/scripts/dist_bundle.pl

    r31506 r31566  
    6262my $streaksrelease   = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1);
    6363my $bgtool   = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1);
     64my $staticskytool   = can_run('staticskytool') or (warn "Can't find staticskytool" and $missing_tools = 1);
    6465my $file_cmd   = can_run('file') or (warn "can't find program file" and $missing_tools = 1);
    6566my $zcat   = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1);
     
    124125$ipprc->outroot_prepare($outroot);
    125126
     127my $num_sky_inputs;
     128if ($stage eq 'sky') {
     129    $num_sky_inputs = get_num_sky_inputs($stage_id);
     130}
    126131# Get the list of data products for this component
    127132# note: We my_die in get_file_list if something goes wrong.
    128133
    129 my $file_list = get_file_list($stage, $component, $path_base, $clean);
     134my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
    130135
    131136if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {
     
    481486    my $path_base = shift;
    482487    my $clean = shift;
     488    my $num_sky_inputs = shift;
    483489
    484490    my @file_list;
     
    532538        $config_file_rule = "PPSTACK.CONFIG";
    533539    } elsif ($stage eq "sky") {
    534         $config_file_rule = "PSPHOT.STACK.CONFIG";
     540        if ($num_sky_inputs > 1) {
     541            $config_file_rule = "PSPHOT.STACK.CONFIG";
     542        } else {
     543            $config_file_rule = "PSPHOT.SKY.CONFIG";
     544        }
    535545    } else {
    536546        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    628638    return \@file_list;
    629639}
     640sub get_num_sky_inputs {
     641    my $sky_id = shift;
     642
     643    my $command = "$staticskytool -inputs -sky_id $sky_id -simple";
     644    $command .= " -dbname $dbname" if $dbname;
     645    $command .= " | wc";
     646    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     647        run(command => $command, verbose => $verbose);
     648    unless ($success) {
     649        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     650        &my_die("Unable to perform $command: $error_code", $component, $error_code);
     651    }
     652    my ($num_inputs, $words, $chars) = split " ", (join "", @$stdout_buf);
     653    if (!$num_inputs) {
     654        $num_inputs = "undefined" if !defined $num_inputs;
     655        &my_die("unexpected number of static sky inputs $num_inputs",  $PS_EXIT_PROG_ERROR, $component, $error_code);
     656    }
     657
     658    return $num_inputs;
     659}
    630660
    631661sub my_die
Note: See TracChangeset for help on using the changeset viewer.