Index: /trunk/ippScripts/scripts/camera_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/camera_exp.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/camera_exp.pl	(revision 13698)
@@ -243,5 +243,5 @@
 	my $command = "$camtool -addprocessedexp -cam_id $cam_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/chip_imfile.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/chip_imfile.pl	(revision 13698)
@@ -77,4 +77,5 @@
 $ppImage .= " -dbname $dbname" if defined $dbname;
 
+&my_die("Couldn't find input file: $input\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);
 
 $workdir = caturi( $workdir, $exp_id ) if defined $workdir;
@@ -82,4 +83,5 @@
 my $outputRoot = $ipprc->file_prepare( "$exp_id.chp$chip_id", $workdir, $input );
 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
+my $outputMask = $ipprc->filename("PPIMAGE.OUTPUT.MASK", $outputRoot, $class_id);
 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
@@ -101,8 +103,9 @@
 	&my_die("Unable to perform ppImage: $error_code", $chip_id, $class_id, $error_code);
     }
-    &my_die("Couldn't find expected output file: $outputImage\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputImage);
-    &my_die("Couldn't find expected output file: $outputBin1\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin1);
-    &my_die("Couldn't find expected output file: $outputBin2\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin2);
-    &my_die("Couldn't find expected output file: $outputStats\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
+    &my_die("Couldn't find expected output file: $outputImage\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);
+    &my_die("Couldn't find expected output file: $outputMask\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
+    &my_die("Couldn't find expected output file: $outputBin1\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
+    &my_die("Couldn't find expected output file: $outputBin2\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
+    &my_die("Couldn't find expected output file: $outputStats\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
 
     # Get the statistics on the processed image
@@ -159,5 +162,5 @@
 	$command .= " -uri $outputImage";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_norm_apply.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 13698)
@@ -149,5 +149,5 @@
 	my $command = "$dettool -addnormalizedimfile -det_id $det_id -iteration $iter -class_id $class_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_norm_calc.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 13698)
@@ -204,5 +204,5 @@
 	my $command = "$dettool -addnormalizedstat -det_id $det_id -iteration $iter -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_norm_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 13698)
@@ -202,5 +202,5 @@
 	my $command = "$dettool -addprocessedimfile -det_id $det_id -iter $iter -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 13698)
@@ -212,5 +212,5 @@
 	my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 13698)
@@ -154,5 +154,5 @@
 	my $command = "$dettool -addprocessedimfile -det_id $det_id -exp_tag $exp_tag -class_id $class_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_reject_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 13698)
@@ -318,5 +318,5 @@
 	my $command = "$dettool -adddetrunsummary -det_id $det_id -iteration $iter -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 13698)
@@ -394,5 +394,5 @@
 	my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_resid.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_resid.pl	(revision 13698)
@@ -217,5 +217,5 @@
 	my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag -class_id $class_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/detrend_stack.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_stack.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/detrend_stack.pl	(revision 13698)
@@ -173,5 +173,5 @@
 	my $command = "$dettool -addstacked -det_id $det_id -iteration $iter -class_id $class_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/diff_skycell.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/diff_skycell.pl	(revision 13698)
@@ -80,6 +80,6 @@
 
 # Identify the input and the template
-my $input;			# Input file
-my $template;			# Template file
+my $input, $inputMask;		# Input file and mask
+my $template, $templateMask;	# Template file and mask
 my $tess_id;			# Tesselation identifier
 my $skycell_id;			# Skycell identifier
@@ -88,6 +88,8 @@
     if (defined $file->{template} and $file->{template}) {
 	$template = $file->{uri};
+	$templateMask = $ipprc->filename("PSWARP.OUTPUT.MASK", $file->{path_base});
     } else {
 	$input = $file->{uri};
+	$inputMask = $ipprc->filename("PSWARP.OUTPUT.MASK", $file->{path_base});
     }
     if (defined $tess_id) {
@@ -115,11 +117,16 @@
 $ipprc->define_camera($camera);
 
+&my_die("Couldn't find input: $template", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($template);
+&my_die("Couldn't find input: $templateMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateMask);
+&my_die("Couldn't find input: $nput", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);
+&my_die("Couldn't find input: $nputMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);
 
 # Get the output filenames
 $workdir = caturi( $workdir, "tess_" . $tess_id, "sky_" . $skycell_id ) if defined $workdir;
 my $outputRoot = $ipprc->file_prepare( "$tess_id.$skycell_id.dif$diff_id", $workdir, $input );
-my $outputName = $outputRoot . ".fits";
-my $bin1Name =  $ipprc->filename("PPIMAGE.BIN1", $outputRoot);
-my $bin2Name =  $ipprc->filename("PPIMAGE.BIN2", $outputRoot);
+my $outputName = $ipprc->filename("PPSUB.OUTPUT", $outputRoot);
+my $outputMask = $ipprc->filename("PPSUB.OUTPUT.MASK", $outputRoot);
+#my $bin1Name =  $ipprc->filename("PPSUB.BIN1", $outputRoot);
+#my $bin2Name =  $ipprc->filename("PPSUB.BIN2", $outputRoot);
 my $outputStats = $outputRoot . '.stats';
 
@@ -133,5 +140,5 @@
 my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
 unless ($no_op) {
-    my $command = "$ppSub $input $template $outputName"; # Command to run ppSub
+    my $command = "$ppSub $input $template $outputName -inmask $inputMask -refmask $templateMask -stat $outputStats"; # Command to run ppSub
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -141,8 +148,9 @@
 	&my_die("Unable to perform ppSub: $error_code", $diff_id, $error_code);
     }
-    &my_die("Couldn't find expected output file: $outputName", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputName);
-#    &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($bin1Name);
-#    &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($bin2Name);
-#    &my_die("Couldn't find expected output file: $outputStats", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
+    &my_die("Couldn't find expected output file: $outputName", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName);
+    &my_die("Couldn't find expected output file: $outputMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
+#    &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);
+#    &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
+    &my_die("Couldn't find expected output file: $outputStats", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
 
     # Get the statistics on the residual image
@@ -164,5 +172,5 @@
     # Add the subtraction result
     {
-	my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName"; # -path_base $outputRoot";
+	my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName -path_base $outputRoot";
 	$command .= " -bg $bg -bg_stdev $bg_stdev";
 	$command .= " -dbname $dbname" if defined $dbname;
@@ -202,5 +210,5 @@
 	my $command = "$difftool -updaterun -diff_id $diff_id -state stop -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/register_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/register_exp.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/register_exp.pl	(revision 13698)
@@ -255,5 +255,5 @@
 	my $command = "$regtool -addprocessedexp -exp_tag $exp_tag -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system($command);
+###        system($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/register_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/register_imfile.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/register_imfile.pl	(revision 13698)
@@ -200,5 +200,5 @@
 	my $command = "$regtool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/stack_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/stack_skycell.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/stack_skycell.pl	(revision 13698)
@@ -113,8 +113,15 @@
     print $listFile "INPUT$num\tMETADATA\n";
     $num++;
-    print $listFile "\tIMAGE\tSTR\t" . $file->{uri} . "\n";
+
+    my $image = $file->{uri};	# Image name
+    my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name
+
+    &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $image );
+    &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask );
+   
+    print $listFile "\tIMAGE\tSTR\t" . $image . "\n";
+    print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 
 
     ### XXX NEED TO UPDATE THESE appropriately
-#    print $listFile "\tMASK\tSTR\t" . "NULL" . "\n"; 
     print $listFile "\tSEEING\tF32\t" . 1.0 . "\n";
     print $listFile "\tWEIGHT\tF32\t" . 1.0 . "\n";
@@ -127,7 +134,8 @@
 $workdir = caturi( $workdir, "tess_" . $tess_id, "sky_" . $skycell_id ) if defined $workdir;
 my $outputRoot = $ipprc->file_prepare( "$tess_id.$skycell_id.stk$stack_id", $workdir, $$files[0]->{uri} );
-my $outputName = $outputRoot . ".fits";
-#my $bin1Name =  $ipprc->filename("PPSTAC.BIN1", $outputRoot);
-#my $bin2Name =  $ipprc->filename("PPSTAC.BIN2", $outputRoot);
+my $outputName = $ipprc->filename("PPSTACK.OUTPUT", $outputRoot);
+my $outputMask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $outputRoot);
+#my $bin1Name =  $ipprc->filename("PPSTACK.BIN1", $outputRoot);
+#my $bin2Name =  $ipprc->filename("PPSTACK.BIN2", $outputRoot);
 my $outputStats = $outputRoot . '.stats';
 
@@ -143,8 +151,9 @@
 	&my_die("Unable to perform ppImage: $error_code", $stack_id, $error_code);
     }
-    &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputName);
-#    &my_die("Couldn't find expected output file: $bin1Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($bin1Name);
-#    &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($bin2Name);
-    &my_die("Couldn't find expected output file: $outputStats", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
+    &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName);
+    &my_die("Couldn't find expected output file: $outputMask", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
+#    &my_die("Couldn't find expected output file: $bin1Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);
+#    &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
+    &my_die("Couldn't find expected output file: $outputStats", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
 
     # Get the statistics on the stacked image
@@ -166,5 +175,5 @@
     # Add the stack result
     {
-	my $command = "$stacktool -addsumskyfile -stack_id $stack_id -uri $outputName"; # -path_base $outputRoot";
+	my $command = "$stacktool -addsumskyfile -stack_id $stack_id -uri $outputName -path_base $outputRoot";
 	$command .= " -bg $bg -bg_stdev $bg_stdev";
 	$command .= " -dbname $dbname" if defined $dbname;
@@ -204,5 +213,5 @@
 	my $command = "$stacktool -updaterun -stack_id $stack_id -state stop -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
Index: /trunk/ippScripts/scripts/warp_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/warp_skycell.pl	(revision 13697)
+++ /trunk/ippScripts/scripts/warp_skycell.pl	(revision 13698)
@@ -88,4 +88,5 @@
 my $outputRoot = $ipprc->file_prepare( "$tess_id.$skycell_id.wrp$warp_id", $workdir, $$imfiles[0]->{uri} );
 my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outputRoot, $skycell_id );
+my $outputMask = $ipprc->filename("PSWARP.OUTPUT.MASK", $outputRoot, $skycell_id);
 my $outputBin1 = $ipprc->filename("PSWARP.BIN1", $outputRoot, $skycell_id );
 my $outputBin2 = $ipprc->filename("PSWARP.BIN2", $outputRoot, $skycell_id );
@@ -94,14 +95,22 @@
 
 # Get list of filenames
-my ($listFile, $listName) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.list.XXXX", UNLINK => 1);
+my ($list1File, $list1Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.image.list.XXXX", UNLINK => 1);
+my ($list2File, $list2Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.mask.list.XXXX", UNLINK => 1);
 foreach my $imfile (@$imfiles) {
-    print $listFile ( $imfile->{uri} . "\n");
+    my $image = $imfile->{uri};	# Image name
+    my $mask = $ipprc->filename("PPIMAGE.OUTPUT.MASK", $imfile->{path_base}, $imfile->{class_id}); # Mask name
+    &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image);
+    &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
+
+    print $list1File ( $image . "\n");
+    print $list2File ( $mask  . "\n");
 }
-close $listFile;
+close $list1File;
+close $list2File;
 
 # Run pswarp
 my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
 unless ($no_op) {
-    my $command = "$pswarp -list $listName $outputRoot $skyFile -stat $outputStats"; # Command to run pswarp
+    my $command = "$pswarp -list $list1Name -masklist $list2Name $outputRoot $skyFile -stat $outputStats"; # Command to run pswarp
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
@@ -110,8 +119,9 @@
 	&my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $error_code);
     }
-    &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputImage);
-    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
-#    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin1);
-#    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin2);
+    &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);
+    &my_die("Couldn't find expected output file: $outputMask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
+    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
+#    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
+#    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
 
     # Get the statistics on the warped image
@@ -130,5 +140,5 @@
 unless ($no_update) {
     my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id" .
-	" -uri $outputImage"; # -path_base $outputRoot"; # Command to run dettool
+	" -uri $outputImage -path_base $outputRoot"; # -path_base $outputRoot"; # Command to run dettool
     $command .= " -bg $bg -bg_stdev $bg_stdev";
     $command .= " -dbname $dbname" if defined $dbname;
@@ -155,5 +165,5 @@
 	my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
+###        system ($command);
     }
     exit $exit_code;
