Index: trunk/ippScripts/scripts/stack_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/stack_skycell.pl	(revision 12021)
+++ trunk/ippScripts/scripts/stack_skycell.pl	(revision 12053)
@@ -16,4 +16,5 @@
 use PS::IPP::Metadata::Config;
 use PS::IPP::Metadata::Stats;
+use PS::IPP::Metadata::List qw( parse_md_list );
 use Data::Dumper;
 
@@ -61,9 +62,9 @@
 }
 
-# Get list of components for subtraction
+# Get list of components for stacking
 my $mdcParser = PS::IPP::Metadata::Config->new;	# Parser for metadata config files
 my $files;
 {
-    my $command = "$stacktool -inputscfile -stack_id $stack_id";
+    my $command = "$stacktool -inputskyfile -stack_id $stack_id";
     $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -71,5 +72,5 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform stacktool -inputscfile: $error_code", $stack_id, $error_code);
+	&my_die("Unable to perform stacktool -inputskyfile: $error_code", $stack_id, $error_code);
     }
 
@@ -83,5 +84,5 @@
     scalar @$files >= 2;
 
-# Identify the input and the template
+# Parse the list of input files, and get the skycell identifier
 my $inputList;			# List of input files
 my $skycell_id;			# Skycell identifier
@@ -106,13 +107,13 @@
 
 # Get the output filenames
-my $outputFile = "$skycell_id.sub.$stack_id"; # Root name
+my $outputFile = "$skycell_id.stack.$stack_id"; # Root name
 my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
 
 my $outputName = $outputRoot . ".fits";
-my $bin1Name =  $ipprc->filename("PPIMAGE.BIN1", $outputRoot);
-my $bin2Name =  $ipprc->filename("PPIMAGE.BIN2", $outputRoot);
+#my $bin1Name =  $ipprc->filename("PPIMAGE.BIN1", $outputRoot);
+#my $bin2Name =  $ipprc->filename("PPIMAGE.BIN2", $outputRoot);
 my $outputStats = $outputRoot . '.stats';
 
-# Perform subtraction
+# Perform stacking
 my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
 unless ($no_op) {
@@ -150,7 +151,7 @@
 unless ($no_update) {
 
-    # Add the subtraction result
+    # Add the stack result
     {
-	my $command = "$stacktool -addsumscfile -stack_id $stack_id -uri $outputName -b1_uri $outputRoot";
+	my $command = "$stacktool -addsumskyfile -stack_id $stack_id -uri $outputName"; # -b1_uri $outputRoot";
 	$command .= " -bg $bg -bg_stdev $bg_stdev";
 	$command .= " -dbname $dbname" if defined $dbname;
@@ -160,5 +161,5 @@
 	unless ($success) {
 	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform stacktool -adddiffscfile: $error_code", $stack_id, $error_code);
+	    &my_die("Unable to perform stacktool -addsumskyfile: $error_code", $stack_id, $error_code);
 	}
 	
