IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9267


Ignore:
Timestamp:
Oct 4, 2006, 2:51:22 PM (20 years ago)
Author:
Paul Price
Message:

Passing the command as an array, since we don't want to split on
whitespace (in particular, there may be whitespace in the object
name).

File:
1 edited

Legend:

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

    r9251 r9267  
    9797# Push the results into the database
    9898unless ($no_update) {
    99     my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPTAG() . " " . $exp_tag . " " .
    100         P0TOOL_CLASSID() . " " . $class_id; # Command to run p0tool
    101    
     99    my @command;
     100    push @command, $p0tool, P0TOOL_MODE(), P0TOOL_EXPTAG(), $exp_tag, P0TOOL_CLASSID(), $class_id; # Command to run p0tool
     101
    102102    foreach my $constant (keys %{CONSTANTS()}) {
    103         $command .= " " . CONSTANTS->{$constant} . " " . ($stats->data($constant))->{value};
     103        push @command, CONSTANTS->{$constant}, ($stats->data($constant))->{value};
    104104    }
    105105    foreach my $variable (keys %{VARIABLES()}) {
    106106        # Just use the mean value
    107         $command .= " " . VARIABLES->{$variable} . " " . ($stats->data($variable))->{mean};
     107        push @command, VARIABLES->{$variable}, ($stats->data($variable))->{mean};
    108108    }
    109 
    110     $command .= " " . P0TOOL_BG_MEAN() . " " . $stats->bg_mean();
     109   
     110    push @command, P0TOOL_BG_MEAN(), $stats->bg_mean(), P0TOOL_BG_STDEV();
    111111    if (defined($stats->bg_stdev())) {
    112         $command .= " " . P0TOOL_BG_STDEV() . " " . $stats->bg_stdev();
     112        push @command, $stats->bg_stdev();
    113113    } else {
    114114        # Will not be defined if there is only a single imfile
    115         $command .= " " . P0TOOL_BG_STDEV() . " 0";
     115        push @command, 0;
    116116    }
    117     $command .= " " . P0TOOL_BG_MEAN_STDEV() . " " . $stats->bg_mean_stdev();
     117    push @command,  P0TOOL_BG_MEAN_STDEV(), $stats->bg_mean_stdev();
    118118 
    119119    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    120         run(command => $command, verbose => 1);
     120        run(command => \@command, verbose => 1);
    121121    die "Unable to perform p0tool -updateimfile: $error_code\n" if not $success;
    122122}
Note: See TracChangeset for help on using the changeset viewer.