Index: trunk/ippScripts/scripts/detrend_stack.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_stack.pl	(revision 11151)
+++ trunk/ippScripts/scripts/detrend_stack.pl	(revision 11297)
@@ -19,5 +19,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $iter, $class_id, $det_type, $camera, $no_update);
+my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
@@ -26,4 +26,5 @@
     'det_type|t=s'      => \$det_type,
     'camera|c=s'        => \$camera,
+    'dbname|d=s'        => \$dbname, # Database name
     'no-update'         => \$no_update
 ) or pod2usage( 2 );
@@ -65,4 +66,5 @@
 {
     my $command = "$dettool -processedimfile -det_id $det_id -class_id $class_id -included"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
@@ -128,4 +130,5 @@
     }
     $command .= ' -bg_mean_stdev ' . $stats->bg_mean_stdev();
+    $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
