Index: trunk/ippScripts/scripts/detrend_reject_exp.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9004)
+++ trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9091)
@@ -15,9 +15,10 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $iter, $det_type);
+my ($det_id, $iter, $det_type, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
     'iteration=s'       => \$iter,
     'det_type|t=s'      => \$det_type,
+    'no-update'         => \$no_update
 ) or pod2usage( 2 );
 
@@ -158,27 +159,29 @@
 
 # Put the result into the database
-{
-    my $command = "$dettool -adddetrunsummary -det_id $det_id -iteration $iter " .
-	"-bg " . $meanStats->mean() . " -bg_stdev " . $stdevStats->mean() .
-	" -bg_mean_stdev " . $meanStdevStats->mean();
-    $command .= " -reject" if not $master;
-
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => 1);
-    die "Unable to perform dettool -adddetrunsummary: $error_code\n" if not $success;
-}
-
-# Re-run processing if required
-{
-    my $command = "$dettool -updatedetrun -det_id $det_id";
-    if ($stop) {
-	$command .= ' -stop';
-    } else {
-	$command .= ' -again';
+unless ($no_update) {
+    {
+	my $command = "$dettool -adddetrunsummary -det_id $det_id -iteration $iter " .
+	    "-bg " . $meanStats->mean() . " -bg_stdev " . $stdevStats->mean() .
+	    " -bg_mean_stdev " . $meanStdevStats->mean();
+	$command .= " -reject" if not $master;
+	
+	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => 1);
+	die "Unable to perform dettool -adddetrunsummary: $error_code\n" if not $success;
     }
     
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => 1);
-    die "Unable to perform dettool -updatedetrun: $error_code\n" if not $success;
+    # Re-run processing if required
+    {
+	my $command = "$dettool -updatedetrun -det_id $det_id";
+	if ($stop) {
+	    $command .= ' -stop';
+	} else {
+	    $command .= ' -again';
+	}
+	
+	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => 1);
+	die "Unable to perform dettool -updatedetrun: $error_code\n" if not $success;
+    }
 }
 __END__
