IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11048


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

expand tabs
rename p0tool -updateimfile -> -addprocessedimfile

File:
1 edited

Legend:

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

    r11036 r11048  
    7676
    7777# Switches for p0tool
    78 use constant P0TOOL_MODE => '-updateimfile'; # Mode for p0tool
     78use constant P0TOOL_MODE => '-addprocessedimfile'; # Mode for p0tool
    7979use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id
    8080use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id
     
    110110        cache_run(command => $command, verbose => 1);
    111111    unless ($success) {
    112         warn ("Unable to perform ppStats on exposure id $exp_tag: $error_code");
    113         &my_die ($exp_tag, $class_id, $error_code);
     112        warn ("Unable to perform ppStats on exposure id $exp_tag: $error_code");
     113        &my_die ($exp_tag, $class_id, $error_code);
    114114    }
    115115   
     
    118118    my $metadata = $mdcParser->parse(join "", @$stdout_buf); # XXX is this join necessary?
    119119    unless ($metadata) {
    120         warn ("Unable to parse metadata config doc");
    121         &my_die ($exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
     120        warn ("Unable to parse metadata config doc");
     121        &my_die ($exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
    122122    }
    123123    my @constants = keys %{CONSTANTS()}; # List of constants to parse out
     
    125125    $stats = PS::IPP::Metadata::Stats->new(\@constants, \@variables); # Stats parser
    126126    unless ($stats->parse($metadata)) {
    127         warn ("Unable to find all values");
    128         &my_die ($exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
    129         # XXX is this a programming or a config error?
     127        warn ("Unable to find all values");
     128        &my_die ($exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
     129        # XXX is this a programming or a config error?
    130130    }
    131131 
     
    133133    my $rnd = rand(1);
    134134    if ($rnd > 0.5) {
    135         warn ("random failure");
    136         &my_die ($exp_tag, $class_id, $PS_EXIT_DATA_ERROR);
     135        warn ("random failure");
     136        &my_die ($exp_tag, $class_id, $PS_EXIT_DATA_ERROR);
    137137    }
    138138}
     
    144144
    145145    foreach my $constant (keys %{CONSTANTS()}) {
    146         push @command, CONSTANTS->{$constant}, ($stats->data($constant))->{value};
     146        push @command, CONSTANTS->{$constant}, ($stats->data($constant))->{value};
    147147
    148148    }
    149149    foreach my $variable (keys %{VARIABLES()}) {
    150150        # Just use the mean value
    151         push @command, VARIABLES->{$variable}, ($stats->data($variable))->{mean};
     151        push @command, VARIABLES->{$variable}, ($stats->data($variable))->{mean};
    152152    }
    153153   
    154154    push @command, P0TOOL_BG_MEAN();
    155155    if (defined $stats->bg_mean()) {
    156         push @command, $stats->bg_mean();
    157     } else {
    158         push @command, "NAN";
     156        push @command, $stats->bg_mean();
     157    } else {
     158        push @command, "NAN";
    159159    }
    160160    push @command, P0TOOL_BG_STDEV();
    161161    if (defined($stats->bg_stdev())) {
    162         push @command, $stats->bg_stdev();
    163     } else {
    164         # Will not be defined if there is only a single imfile
    165         push @command, 0;
     162        push @command, $stats->bg_stdev();
     163    } else {
     164        # Will not be defined if there is only a single imfile
     165        push @command, 0;
    166166    }
    167167    push @command,  P0TOOL_BG_MEAN_STDEV();
    168168    if (defined $stats->bg_mean_stdev()) {
    169         push @command, $stats->bg_mean_stdev();
    170     } else {
    171         push @command, "NAN";
     169        push @command, $stats->bg_mean_stdev();
     170    } else {
     171        push @command, "NAN";
    172172    }
    173173
    174174    # Quote arguments with whitespace
    175175    for (my $i = 0; $i < scalar @command; $i++) {
    176         if ($command[$i] =~ /\s/) {
    177             $command[$i] = "\'$command[$i]\'";
    178         }
     176        if ($command[$i] =~ /\s/) {
     177            $command[$i] = "\'$command[$i]\'";
     178        }
    179179    }
    180180
     
    183183
    184184    unless ($success) {
    185         # XXX this is tricky: if we can't run -updateimfile, can we actually set the error code?
    186         # XXX if this is not a database error, it is probably a programming error (in p0tool or the passed args)
    187         warn ("Unable to perform p0tool -updateimfile: $error_code");
    188         &my_die ($exp_tag, $class_id, $error_code);
     185        # XXX this is tricky: if we can't run -updateimfile, can we actually set the error code?
     186        # XXX if this is not a database error, it is probably a programming error (in p0tool or the passed args)
     187        warn ("Unable to perform p0tool -updateimfile: $error_code");
     188        &my_die ($exp_tag, $class_id, $error_code);
    189189    }
    190190}
     
    210210    my $exit_code = $_[2];
    211211    if ($exp_tag && $class_id) {
    212         system ("$p0tool -faultimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code");
     212        system ("$p0tool -faultimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code");
    213213    }
    214214    exit $exit_code;
Note: See TracChangeset for help on using the changeset viewer.