Changeset 12673 for trunk/ippScripts/scripts/detrend_reject_exp.pl
- Timestamp:
- Mar 29, 2007, 10:25:51 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_reject_exp.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_reject_exp.pl
r11837 r12673 121 121 my $reject_meanstdev = rejection_limit( 'ENSEMBLE.MEANSTDEV', $det_type, $filter ); 122 122 123 print "Ensemble mean " . $meanStats->mean() . " +/- " . $meanStats->standard_deviation . 124 ", stdev " . $stdevStats->mean() . " +/- " . $stdevStats->standard_deviation() . "\n\n"; 123 $workdir = $ipprc->convert_filename_absolute( $workdir ); 124 125 my $logName = "$camera.$det_type.$det_id.$iter.detreject.log"; # Name for log 126 $logName = File::Spec->catfile( $workdir, $logName ); 127 my $logFile; 128 unless ($no_op) { 129 open $logFile, "> $logName" or &my_die("Unable to open log file $logName.\n", $det_id, $iter, $PS_EXIT_SYS_ERROR); 130 print $logFile "Ensemble mean " . $meanStats->mean() . " +/- " . $meanStats->standard_deviation . 131 ", stdev " . $stdevStats->mean() . " +/- " . $stdevStats->standard_deviation() . "\n\n"; 132 } 125 133 126 134 # Go through again to do rejection, and update the database for each exposure … … 139 147 if (not $accept[$i]) { 140 148 # Rejected this at an earlier stage 141 print "Rejecting $expTag based on earlier determination.\n"; 149 unless ($no_op) { 150 print $logFile "Rejecting $expTag based on earlier determination.\n"; 151 } 142 152 $reject = 1; 143 153 goto UPDATE; … … 157 167 my $dMean = abs($means[$i] - $meanStats->mean()) ; 158 168 if ($dMean > ($reject_mean * $meanStats->standard_deviation())) { 159 print "Rejecting $expTag based on outliermean value: " .169 print $logFile "Rejecting $expTag based on ensemble mean value: " . 160 170 "$means[$i] --> $dMean vs " . $reject_mean * $meanStats->standard_deviation() . "\n"; 161 171 $reject = 1; 162 goto UPDATE;172 #goto UPDATE; 163 173 } 164 174 } else { 165 print "no rejection for exposure mean\n";175 print $logFile "No rejection for ensemble mean\n"; 166 176 } 167 177 … … 169 179 my $dMean = abs($stdevs[$i] - $stdevStats->mean()); 170 180 if ($dMean > ($reject_stdev * $stdevStats->standard_deviation())) { 171 print "Rejecting $expTag based on outlierstdev: " .181 print $logFile "Rejecting $expTag based on ensemble stdev: " . 172 182 $stdevs[$i] . " --> $dMean sigma vs " . $reject_stdev . "\n"; 173 183 $reject = 1; 174 goto UPDATE;184 #goto UPDATE; 175 185 } 176 186 } else { 177 print "no rejection for exposure stdev\n";187 print $logFile "No rejection for ensemble stdev\n"; 178 188 } 179 189 … … 181 191 my $dMean = abs($meanStdevs[$i] - $meanStdevStats->mean()); 182 192 if ($dMean > ($reject_meanstdev * $meanStdevStats->standard_deviation())) { 183 print "Rejecting $expTag based on outliermean stdev: " .193 print $logFile "Rejecting $expTag based on ensemble mean stdev: " . 184 194 $meanStdevs[$i] . " --> $dMean sigma vs " . $reject_meanstdev . "\n"; 185 195 $reject = 1; 186 goto UPDATE;196 #goto UPDATE; 187 197 } 188 198 } else { 189 print "no rejection for exposure mean stdev\n";199 print $logFile "No rejection for ensemble mean stdev\n"; 190 200 } 191 201 … … 198 208 # Check for status changes 199 209 if ((not $include[$i] and not $reject) or ($include[$i] and $reject)) { 200 print "Status of $expTag has changed.\n"; 210 unless ($no_op) { 211 print $logFile "Status of $expTag has changed.\n"; 212 } 201 213 $numChanges++; 202 214 } … … 228 240 } 229 241 230 print "Master: $master\n"; 231 print "Stop: $stop\n"; 242 unless ($no_op) { 243 print $logFile "Master: $master\n"; 244 print $logFile "Stop: $stop\n"; 245 close $logFile; 246 } 232 247 233 248 # Put results into the database
Note:
See TracChangeset
for help on using the changeset viewer.
