Index: trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_resid.pl	(revision 11151)
+++ trunk/ippScripts/scripts/detrend_resid.pl	(revision 11297)
@@ -20,5 +20,5 @@
 
 my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
-        $input_uri, $camera, $mode, $no_update);
+        $input_uri, $camera, $mode, $dbname, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
@@ -31,4 +31,5 @@
     'camera|c=s'        => \$camera,
     'mode|m=s'          => \$mode,
+    'dbname|d=s'        => \$dbname, # Database name
     'no-update'         => \$no_update,
 ) or pod2usage( 2 );
@@ -155,4 +156,5 @@
 	"-b2_uri $bin2Name"; # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
+    $command .= " -dbname $dbname" if defined $dbname;
 
     if (defined($stats->bg_mean_stdev())) {
