Index: /trunk/ippScripts/scripts/detrend_norm_apply.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 11394)
@@ -104,6 +104,6 @@
     }
     &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $output;
-    &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b2name;
-    &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b1name;
+    &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b1name;
+    &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b2name;
     &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $statsName;
 }
@@ -129,5 +129,5 @@
 unless ($no_update) {
     my $command = "$dettool -addnormalizedimfile -det_id $det_id -iteration $iter -class_id $class_id ".
-	"-uri $output -b1_uri $b1name -b2_uri $b2name"; # Command to run
+	"-uri $output -b1_uri $outputRoot"; # Command to run
     # Add the statistics triplet
     $command .= " -bg " . $stats->bg_mean();
Index: /trunk/ippScripts/scripts/detrend_norm_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 11394)
@@ -128,6 +128,7 @@
 open my $list2File, '>' . $list2Name;
 foreach my $file (@$files) {
-    print $list1File ($ipprc->convert_filename_absolute( $file->{b1_uri} ) . "\n");
-    print $list2File ($ipprc->convert_filename_absolute( $file->{b2_uri} ) . "\n");
+    my $origRoot = $ipprc->convert_filename_absolute( $file->{b1_uri} ); # Original root name
+    print $list1File ( $ipprc->filename( "PPIMAGE.BIN1", $origRoot, $file->{class_id} ) . "\n");
+    print $list2File ( $ipprc->filename( "PPIMAGE.BIN2", $origRoot, $file->{class_id} ) . "\n");
     push @means, $file->{bg};
     push @stdevs, $file->{bg_stdev};
@@ -161,5 +162,5 @@
 unless ($no_update) {
     my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter " .
-	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
+	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $outputRoot " .
 	"-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     $command .= " -dbname $dbname" if defined $dbname;
Index: /trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 11394)
@@ -109,5 +109,5 @@
     $workdir = $ipprc->convert_filename_absolute( $workdir );
 } else {
-    my $example = ${$files}[0]->{b1_uri}; # Example filename
+    my $example = ${$files}[0]->{b1_uri}; # Example original root name
     my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     $workdir = $dir;
@@ -124,6 +124,7 @@
 open my $list2File, '>' . $list2Name;
 foreach my $file (@$files) {
-    print $list1File ($ipprc->convert_filename_absolute( $file->{b1_uri} ) . "\n");
-    print $list2File ($ipprc->convert_filename_absolute( $file->{b2_uri} ) . "\n");
+    my $origRoot = $ipprc->convert_filename_absolute( $file->{b1_uri} ); # Original root name
+    print $list1File ($ipprc->filename( "PPIMAGE.BIN1", $origRoot, $file->{class_id} ) . "\n");
+    print $list2File ($ipprc->filename( "PPIMAGE.BIN2", $origRoot, $file->{class_id} ) . "\n");
     push @means, $file->{bg};
     push @stdevs, $file->{bg_stdev};
@@ -167,5 +168,5 @@
 unless ($no_update) {
     my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .
-	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1 -b2_uri $jpeg2 " .
+	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $outputRoot " .
 	"-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     $command .= " -dbname $dbname" if defined $dbname;
Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 11394)
@@ -135,6 +135,5 @@
 unless ($no_update) {
     my $command = "$dettool -addprocessedimfile -det_id $det_id -exp_tag $exp_tag " .
-	"-class_id $class_id -recip $recipe -uri $outputImage -b1_uri $outputBin1 " .
-	"-b2_uri $outputBin2"; # Command to run dettool
+	"-class_id $class_id -recip $recipe -uri $outputImage -b1_uri $outputRoot";  # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
     if (defined($stats->bg_stdev())) {
Index: /trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 11394)
@@ -89,5 +89,5 @@
     $workdir = $ipprc->convert_filename_absolute( $workdir );
 } else {
-    my $example = ${$files}[0]->{b1_uri}; # Example file
+    my $example = ${$files}[0]->{b1_uri}; # Example original root name
     my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     $workdir = $dir;
@@ -107,6 +107,7 @@
 open my $list2File, '>' . $list2Name;
 foreach my $file (@$files) {
-    print $list1File ($ipprc->convert_filename_absolute( $file->{b1_uri} ) . "\n");
-    print $list2File ($ipprc->convert_filename_absolute( $file->{b2_uri} ) . "\n");
+    my $origRoot = $ipprc->convert_filename_absolute( $file->{b1_uri} ); # Original root name
+    print $list1File ($ipprc->filename( "PPIMAGE.BIN1", $origRoot, $file->{class_id} ) . "\n");
+    print $list2File ($ipprc->filename( "PPIMAGE.BIN2", $origRoot, $file->{class_id} ) . "\n");
     push @means, $file->{bg};
     push @meanStdevs, $file->{bg_mean_stdev};
@@ -270,5 +271,5 @@
 unless ($no_update) {
     my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
-	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
+	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $outputRoot " .
 	"-bg $mean -bg_stdev $stdev -bg_mean_stdev $meanStdev";	# Command to run
     $command .= ' -reject' if $reject;
Index: /trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_resid.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/detrend_resid.pl	(revision 11394)
@@ -174,6 +174,5 @@
 unless ($no_update) {
     my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
-	"-class_id $class_id -recip $recipe -uri $outputName -b1_uri $bin1Name " .
-	"-b2_uri $bin2Name"; # Command to run dettool
+	"-class_id $class_id -recip $recipe -uri $outputName -b1_uri $outputRoot"; # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
     $command .= " -dbname $dbname" if defined $dbname;
Index: /trunk/ippScripts/scripts/phase2.pl
===================================================================
--- /trunk/ippScripts/scripts/phase2.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/phase2.pl	(revision 11394)
@@ -127,6 +127,5 @@
     $command .= " -recip " . RECIPE;
     $command .= " -uri $outputImage";
-    $command .= " -b1_uri $outputBin1";
-    $command .= " -b2_uri $outputBin2";
+    $command .= " -b1_uri $outputRoot";
     $command .= " -bg " . $stats->bg_mean();
     $command .= " -bg_stdev " . $stats->bg_stdev();
Index: /trunk/ippScripts/scripts/phase3.pl
===================================================================
--- /trunk/ippScripts/scripts/phase3.pl	(revision 11393)
+++ /trunk/ippScripts/scripts/phase3.pl	(revision 11394)
@@ -118,5 +118,5 @@
     $workdir = $ipprc->convert_filename_absolute( $workdir );
 } else {
-    my $example = ${$files}[0]->{b1_uri}; # Example filename
+    my $example = ${$files}[0]->{b1_uri}; # Example original root name
     my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     $workdir = $dir;
@@ -137,10 +137,10 @@
     # use the b1_uri as OUTPUT root and convert the filenames
     # with ipprc->filename:
-    my $classID = $file->{class_id};
-    my $fileRoot = $file->{b1_uri};
-    print $list1File $ipprc->filename("PPIMAGE.BIN1", $file->{b1_uri}, $classID);
-    print $list2File $ipprc->filename("PPIMAGE.BIN2", $file->{b1_uri}, $classID);
-    print $list1File $ipprc->filename("PSPHOT.OUTPUT", $file->{b1_uri}, $classID);
-    print $list1File $ipprc->filename("PSASTRO.OUTPUT", $file->{b1_uri}, $classID);
+    my $class_id = $file->{class_id};
+    my $origRoot = $ipprc->convert_filename_absolute( $file->{b1_uri} ); # Original root name
+    print $list1File $ipprc->filename("PPIMAGE.BIN1", $origRoot, $class_id);
+    print $list2File $ipprc->filename("PPIMAGE.BIN2", $origRoot, $class_id);
+    print $list1File $ipprc->filename("PSPHOT.OUTPUT", $origRoot, $class_id);
+    print $list1File $ipprc->filename("PSASTRO.OUTPUT", $origRoot, $class_id);
     # XXX PSASTRO.OUTPUT is explicitly a CHIP output file 
     # XXX below the PSASTRO.OUTPUT must be an FPA output file
@@ -196,5 +196,5 @@
 unless ($no_update) {
     my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -uri UNKNOWN " .
-	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1 -b2_uri $jpeg2 " .
+	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $outputRoot " .
 	"-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev " .
 	"-sigma_ra 0.0 -sigma_dec 0.0 -nastro 0 -zp_mean 0.0 -zp_stdev 0.0"; # Command to run
