Index: trunk/ippScripts/scripts/ipp_serial_detrend.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_serial_detrend.pl	(revision 14159)
+++ trunk/ippScripts/scripts/ipp_serial_detrend.pl	(revision 14170)
@@ -61,4 +61,5 @@
 		my $det_type = $item->{det_type};
 		my $exp_tag = $item->{exp_tag};
+		my $exp_id = $item->{exp_id};
 		my $class_id = $item->{class_id};
 		my $uri = $item->{uri};
@@ -67,5 +68,5 @@
 		my $reduction = $item->{reduction};
 
-		my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname";
+		my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname";
 		$command .= " --reduction $reduction" if defined $reduction;
 		$command .= " --workdir $workdir" if defined $workdir;
@@ -92,10 +93,11 @@
     foreach my $item (@$list) {
 	my $exp_tag = $item->{exp_tag};
-	my $camera = $item->{camera};
-	my $det_id = $item->{det_id};
-	my $det_type = $item->{det_type};
-	my $workdir = $item->{workdir};
-
-	my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --camera $camera --dbname $dbname";
+	my $exp_id = $item->{exp_id};
+	my $camera = $item->{camera};
+	my $det_id = $item->{det_id};
+	my $det_type = $item->{det_type};
+	my $workdir = $item->{workdir};
+
+	my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --exp_id $exp_id --camera $camera --dbname $dbname";
 	$command .= " --workdir $workdir" if defined $workdir;
     	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -230,4 +232,5 @@
 	    foreach my $item (@$list) {
 		my $exp_tag = $item->{exp_tag};
+		my $exp_id = $item->{exp_id};
 		my $camera = $item->{camera};
 		my $det_id = $item->{det_id};
@@ -241,5 +244,5 @@
 		my $reduction = $item->{reduction};
 
-		my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname";
+		my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname";
 		$command .= " --reduction $reduction" if defined $reduction;
 		$command .= " --detrend $detrend" if defined $detrend;
@@ -268,11 +271,12 @@
     foreach my $item (@$list) {
 	my $exp_tag = $item->{exp_tag};
-	my $camera = $item->{camera};
-	my $det_id = $item->{det_id};
-	my $iteration = $item->{iteration};
-	my $det_type = $item->{det_type};
-	my $workdir = $item->{workdir};
-
-	my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --det_type $det_type --camera $camera --dbname $dbname";
+	my $exp_id = $item->{exp_id};
+	my $camera = $item->{camera};
+	my $det_id = $item->{det_id};
+	my $iteration = $item->{iteration};
+	my $det_type = $item->{det_type};
+	my $workdir = $item->{workdir};
+
+	my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --det_type $det_type --camera $camera --dbname $dbname";
 	$command .= " --workdir $workdir" if defined $workdir;
     	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
