Index: trunk/ippScripts/scripts/stack_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/stack_skycell.pl	(revision 14239)
+++ trunk/ippScripts/scripts/stack_skycell.pl	(revision 14274)
@@ -34,5 +34,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($stack_id, $dbname, $workdir, $no_update, $no_op);
+my ($stack_id, $dbname, $workdir, $no_update, $no_op, $save_temps);
 GetOptions(
     'stack_id|d=s'      => \$stack_id, # Stack identifier
@@ -41,4 +41,5 @@
     'no-update'         => \$no_update,	# Don't update the database?
     'no-op'             => \$no_op, # Don't do any operations?
+    'save-temps'        => \$save_temps, # Save temporary files?
 ) or pod2usage( 2 );
 
@@ -116,5 +117,6 @@
 
 # Generate MDC file with the inputs
-my ($listFile, $listName) = tempfile( "$tess_id.$skycell_id.stk$stack_id.list.XXXX", UNLINK => 1 );
+my ($listFile, $listName) = tempfile( "$tess_id.$skycell_id.stk$stack_id.list.XXXX",
+				      UNLINK => !$save_temps );
 my $num = 0;
 foreach my $file (@$files) {
@@ -124,4 +126,5 @@
     my $image = $file->{uri};	# Image name
     my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name
+    my $weight = $ipprc->filename( "PSWARP.OUTPUT.WEIGHT", $file->{path_base} ); # Weight name
 
     &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $image );
@@ -130,8 +133,9 @@
     print $listFile "\tIMAGE\tSTR\t" . $image . "\n";
     print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 
+    print $listFile "\tWEIGHT\tSTR\t" . $weight . "\n"; 
 
     ### XXX NEED TO UPDATE THESE appropriately
     print $listFile "\tSEEING\tF32\t" . 1.0 . "\n";
-    print $listFile "\tWEIGHT\tF32\t" . 1.0 . "\n";
+    print $listFile "\tWEIGHTING\tF32\t" . 1.0 . "\n";
     print $listFile "\tSCALE\tF32\t" . 1.0 . "\n";
 
@@ -144,4 +148,5 @@
 my $outputName = $ipprc->filename("PPSTACK.OUTPUT", $outputRoot);
 my $outputMask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $outputRoot);
+my $outputWeight = $ipprc->filename("PPSTACK.OUTPUT.WEIGHT", $outputRoot);
 #my $bin1Name =  $ipprc->filename("PPSTACK.BIN1", $outputRoot);
 #my $bin2Name =  $ipprc->filename("PPSTACK.BIN2", $outputRoot);
@@ -152,5 +157,5 @@
     my $command = "$ppStack $listName $outputRoot";
     $command .= " -stats $outputStats";
-    $command .= " -recipe PPSTATS CHIPSTATS";
+    $command .= " -recipe PPSTATS WARPSTATS";
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -162,4 +167,5 @@
     &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: $outputWeight", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
 #    &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);
