Index: trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 10719)
+++ trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 11297)
@@ -19,5 +19,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $iter, $exp_tag, $det_type, $camera, $filter, $no_update, $reject);
+my ($det_id, $iter, $exp_tag, $det_type, $camera, $filter, $reject, $dbname, $no_update);
 GetOptions(
 	   'det_id|d=s'        => \$det_id,
@@ -25,8 +25,9 @@
 	   'exp_tag|e=s'       => \$exp_tag,
 	   'det_type|t=s'      => \$det_type,
-	   'no-update'         => \$no_update,
 	   'camera=s'          => \$camera,
 	   'filter=s'          => \$filter,
 	   'reject'            => \$reject
+	   'dbname|d=s'        => \$dbname, # Database name
+	   'no-update'         => \$no_update,
 	   ) or pod2usage( 2 );
 
@@ -58,4 +59,5 @@
 {
     my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
@@ -239,4 +241,5 @@
 	"-bg $mean -bg_stdev $stdev -bg_mean_stdev $meanStdev";	# Command to run
     $command .= ' -reject' if $reject;
+    $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
