Index: trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 19261)
+++ trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 19652)
@@ -57,5 +57,5 @@
 
 if ($redirect) {
-    my $logDest = $ipprc->filename("LOG.EXP", $outroot, "NONE") 
+    my $logDest = $ipprc->filename("LOG.EXP", $outroot, "NONE")
         or &my_die("Missing entry in file rules", $det_id, $exp_id, $PS_EXIT_CONFIG_ERROR);
     $ipprc->redirect_output($logDest);
@@ -65,9 +65,6 @@
 $reduction = 'DETREND' unless defined $reduction;
 
-my $recipe1 = $ipprc->reduction($reduction, 'JPEG_BIN1_IMAGE_' . uc($det_type)); # Recipe to use
-&my_die("Unrecognised detrend type: $det_type", $det_id, $exp_id, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
-
-my $recipe2 = $ipprc->reduction($reduction, 'JPEG_BIN2_IMAGE_' . uc($det_type)); # Recipe to use
-&my_die("Unrecognised detrend type: $det_type", $det_id, $exp_id, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
+my $recipe = $ipprc->reduction($reduction, uc($det_type) . '_JPEG_IMAGE'); # Recipe to use
+&my_die("Unrecognised detrend type: $det_type", $det_id, $exp_id, $PS_EXIT_PROG_ERROR) unless defined $recipe;
 
 # values to extract from output metadata and the stats to calculate
@@ -144,5 +141,7 @@
 unless ($no_op) {
     # Make the jpeg for binning 1
-    $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run
+    $command = "$ppImage -list $list1Name $outroot"; # Command to run
+    $command .= " -recipe PPIMAGE PPIMAGE_N";
+    $command .= " -recipe JPEG $recipe";
     $command .= " -dbname $dbname" if defined $dbname;
     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -155,5 +154,7 @@
 
     # Make the jpeg for binning 2
-    $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run
+    $command = "$ppImage -list $list2Name $outroot"; # Command to run
+    $command .= " -recipe PPIMAGE PPIMAGE_N";
+    $command .= " -recipe JPEG $recipe";
     $command .= " -dbname $dbname" if defined $dbname;
     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -200,5 +201,5 @@
         $command .= " -exp_id $exp_id";
         $command .= " -code $exit_code";
-	$command .= " -path_base $outroot";
+        $command .= " -path_base $outroot";
         $command .= " -dbname $dbname" if defined $dbname;
         system ($command);
