IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2007, 3:44:12 PM (19 years ago)
Author:
jhoblitt
Message:

expand tabs
rename p0tool -updateexp -> -addprocessedexp

File:
1 edited

Legend:

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

    r11036 r11049  
    5252# These values should be constant for all components
    5353use constant CONSTANTS => [
    54                            "object", # Object
     54                           "object", # Object
    5555                           "exp_type", # Exposure type
    5656                           "filter", # Filter used
     
    9898        cache_run(command => $command, verbose => 1);
    9999    unless ($success) {
    100         warn ("Unable to perform p0tool on exposure id $exptag: $error_code");
    101         &my_die ($exptag, $error_code);
     100        warn ("Unable to perform p0tool on exposure id $exptag: $error_code");
     101        &my_die ($exptag, $error_code);
    102102    }
    103103
    104104    my $metadata = $mdcParser->parse(join "", @$stdout_buf);
    105105    unless ($metadata) {
    106         warn ("Unable to parse metadata config doc");
    107         &my_die ($exptag, $PS_EXIT_PROG_ERROR);
     106        warn ("Unable to parse metadata config doc");
     107        &my_die ($exptag, $PS_EXIT_PROG_ERROR);
    108108    }
    109109    $imfiles = parse_md_list($metadata); # Data for imfiles
     
    125125            $values{$constant} = $value;
    126126        }
    127         if ($values{$constant} ne $value) {
     127        if ($values{$constant} ne $value) {
    128128            warn ("Value of $constant for $imfile->{PHASE0_CLASSID} doesn't match previous value");
    129             &my_die ($exptag, $PS_EXIT_PROG_ERROR);
     129            &my_die ($exptag, $PS_EXIT_PROG_ERROR);
    130130        }
    131131    }
     
    154154unless ($no_update) {
    155155    my @command;
    156     push @command, $p0tool, '-updateexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters
     156    push @command, $p0tool, '-addprocessedexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters
    157157   
    158158    # Add the values of interest
    159159    foreach my $constant (@{CONSTANTS()}) {
    160         push @command, ( '-' . $constant ), $values{$constant};
     160        push @command, ( '-' . $constant ), $values{$constant};
    161161    }
    162162    foreach my $variable (@{VARIABLES()}) {
     
    164164        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    165165        $stats->add_data(@$array);
    166         push @command, ( '-' . $variable ), $stats->mean();
     166        push @command, ( '-' . $variable ), $stats->mean();
    167167    }
    168168
     
    171171        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    172172        $stats->add_data(@backgrounds);
    173         push @command, ( '-' . PHASE0_BG() ), $stats->mean();
    174         push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
     173        push @command, ( '-' . PHASE0_BG() ), $stats->mean();
     174        push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
    175175    }
    176176    {
    177177        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    178178        $stats->add_data(@variances);
    179         push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
     179        push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
    180180    }
    181181   
     
    183183    foreach my $detrendType (@{DETRENDS()}) {
    184184        if (lc($values{TYPE()}) =~ /$detrendType/) {
    185             push @command, DETREND_FLAG;
     185            push @command, DETREND_FLAG;
    186186            last;
    187187        }
     
    190190    # Quote arguments with whitespace
    191191    for (my $i = 0; $i < scalar @command; $i++) {
    192         if ($command[$i] =~ /\s/) {
    193             $command[$i] = "\'$command[$i]\'";
    194         }
     192        if ($command[$i] =~ /\s/) {
     193            $command[$i] = "\'$command[$i]\'";
     194        }
    195195    }
    196196
     
    198198        cache_run(command => \@command, verbose => 1);
    199199    unless ($success) {
    200         warn ("Unable to run phase0 update for $exptag: $error_code");
    201         &my_die ($exptag, $error_code);
     200        warn ("Unable to run phase0 update for $exptag: $error_code");
     201        &my_die ($exptag, $error_code);
    202202    }
    203203}
     
    213213
    214214    unless (defined $imfile->{$name}) {
    215         warn ("Couldn't find value of $name for class_id=$source");
    216         &my_die ($exptag, $PS_EXIT_PROG_ERROR);
     215        warn ("Couldn't find value of $name for class_id=$source");
     216        &my_die ($exptag, $PS_EXIT_PROG_ERROR);
    217217    }
    218218    return $imfile->{$name};
     
    238238    my $exit_code = $_[1];
    239239    if ($exp_tag) {
    240         system ("$p0tool -faultexp -exp_tag $exp_tag -code $exit_code");
     240        system ("$p0tool -faultexp -exp_tag $exp_tag -code $exit_code");
    241241    }
    242242    exit $exit_code;
Note: See TracChangeset for help on using the changeset viewer.