Changeset 9268
- Timestamp:
- Oct 4, 2006, 2:56:48 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/phase0_exp.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/phase0_exp.pl
r9251 r9268 119 119 # Output results to the database 120 120 unless ($no_update) { 121 my $command = "$p0tool -updateexp -exp_tag $exptag"; # Command to execute to update exposure parameters 121 my @command; 122 push @command, $p0tool, '-updateexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters 122 123 123 124 # Add the values of interest 124 125 foreach my $constant (@{CONSTANTS()}) { 125 $command .= " -" . $constant . " " .$values{$constant};126 push @command, ( '-' . $constant ), $values{$constant}; 126 127 } 127 128 foreach my $variable (@{VARIABLES()}) { … … 129 130 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 130 131 $stats->add_data(@$array); 131 $command .= " -" . $variable . " " .$stats->mean();132 push @command, ( '-' . $variable ), $stats->mean(); 132 133 } 133 134 … … 136 137 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 137 138 $stats->add_data(@backgrounds); 138 $command .= " -" . PHASE0_BG() . " " . $stats->mean();139 push @command, ( '-' . PHASE0_BG() ), $stats->mean(), ( '-' . PHASE0_BG_STDEV() ); 139 140 if (scalar @backgrounds == 1) { 140 $command .= ' -' . PHASE0_BG_STDEV() . " 0.0";141 push @command, 1; 141 142 } else { 142 $command .= " -" . PHASE0_BG_STDEV() . " " .$stats->standard_deviation();143 push @command, $stats->standard_deviation(); 143 144 } 144 145 } … … 146 147 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 147 148 $stats->add_data(@stdevs); 148 $command .= " -" . PHASE0_BG_MEAN_STDEV() . " " .$stats->mean();149 push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), $stats->mean(); 149 150 } 150 151 … … 152 153 foreach my $detrendType (@{DETRENDS()}) { 153 154 if (lc($values{TYPE()}) eq lc($detrendType)) { 154 $command .= " " .DETREND_FLAG;155 push @command, DETREND_FLAG; 155 156 last; 156 157 } … … 158 159 159 160 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 160 run(command => $command, verbose => 1);161 run(command => \@command, verbose => 1); 161 162 die "Unable to run phase0 update for $exptag: $error_code\n" if not $success; 162 163 }
Note:
See TracChangeset
for help on using the changeset viewer.
