Index: /trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/diff_skycell.pl	(revision 12042)
+++ /trunk/ippScripts/scripts/diff_skycell.pl	(revision 12043)
@@ -65,5 +65,5 @@
 my $files;
 {
-    my $command = "$difftool -inputscfile -diff_id $diff_id";
+    my $command = "$difftool -inputskyfile -diff_id $diff_id";
     $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -71,5 +71,5 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform difftool -inputscfile: $error_code", $diff_id, $error_code);
+	&my_die("Unable to perform difftool -inputskyfile: $error_code", $diff_id, $error_code);
     }
 
@@ -160,5 +160,5 @@
     # Add the subtraction result
     {
-	my $command = "$difftool -adddiffscfile -diff_id $diff_id -uri $outputName -b1_uri $outputRoot";
+	my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName -b1_uri $outputRoot";
 	$command .= " -bg $bg -bg_stdev $bg_stdev";
 	$command .= " -dbname $dbname" if defined $dbname;
@@ -168,5 +168,5 @@
 	unless ($success) {
 	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform difftool -adddiffscfile: $error_code", $diff_id, $error_code);
+	    &my_die("Unable to perform difftool -adddiffskyfile: $error_code", $diff_id, $error_code);
 	}
 	
Index: /trunk/ippScripts/scripts/warp_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/warp_imfile.pl	(revision 12042)
+++ /trunk/ippScripts/scripts/warp_imfile.pl	(revision 12043)
@@ -16,4 +16,5 @@
 use PS::IPP::Metadata::Config;
 use PS::IPP::Metadata::Stats;
+use PS::IPP::Metadata::List qw( parse_md_list );
 
 use PS::IPP::Config qw(
@@ -32,8 +33,9 @@
 use Pod::Usage qw( pod2usage );
 
-my ($warp_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);
+my ($warp_id, $skycell_id, $tess_id, $camera, $dbname, $workdir, $no_update, $no_op);
 GetOptions(
     'warp_id|i=s'       => \$warp_id, # Warp identifier
     'skycell_id|s=s'    => \$skycell_id, # Skycell identifier
+    'tess_id|s=s'       => \$tess_id, # Tesselation identifier
     'camera|c=s'        => \$camera, # Camera name
     'dbname|d=s'        => \$dbname, # Database name
@@ -45,8 +47,9 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --warp_id --skycell_id --camera",
+    -msg => "Required options: --warp_id --skycell_id --tess_id --camera",
     -exitval => 3,
 ) unless defined $warp_id
     and defined $skycell_id
+    and defined $tess_id
     and defined $camera;
 
@@ -66,5 +69,5 @@
 my $imfiles;
 {
-    my $command = "$warptool -imfile -warp_id $warp_id -skycell_id $skycell_id";
+    my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id";
     $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -72,11 +75,11 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $skycell_id, $error_code);
+	&my_die("Unable to perform warptool -scmap: $error_code", $warp_id, $skycell_id, $tess_id, $error_code);
     }
 
     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
-	&my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     $imfiles = parse_md_list($metadata) or 
-	&my_die("Unable to parse metadata list", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to parse metadata list", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
 }
 
@@ -85,5 +88,6 @@
     $workdir = $ipprc->convert_filename_absolute( $workdir );
 } else {
-    my ($vol, $dir, $file) = File::Spec->splitpath( $$imfiles[0]->{uri} );
+    my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} );
+    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     $workdir = $dir;
 }
@@ -97,5 +101,5 @@
 
 # Get list of filenames
-open my $listFile, '>' . $listName;
+open my $listFile, "> $listName" or &my_die("Unable to open $listName", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR);
 foreach my $imfile (@$imfiles) {
     my $uri = $ipprc->convert_filename_absolute( $imfile->{uri} );
@@ -115,8 +119,8 @@
 	&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, $PS_EXIT_SYS_ERROR) unless -f $outputImage;
-    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
-    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
-    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
+    &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage;
+    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
+    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
+    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
 
     # Get the statistics on the warped image
@@ -126,6 +130,6 @@
     close $statsFile;
     my $metadata = $mdcParser->parse(join "", @contents)
-        or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
-    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+        or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
+    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
 }
 
@@ -140,6 +144,6 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id" .
-	" -uri $outputImage -b1_uri $outputRoot";  # Command to run dettool
+    my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id" .
+	" -uri $outputImage"; # -b1_uri $outputRoot";  # Command to run dettool
     $command .= " -bg $bg -bg_stdev $bg_stdev";
     $command .= " -dbname $dbname" if defined $dbname;
@@ -149,5 +153,5 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	warn("Unable to perform warptool -addwarpedimfile: $error_code\n");
+	warn("Unable to perform warptool -addwarped: $error_code\n");
 	exit($error_code);
     }
@@ -161,9 +165,10 @@
     my $warp_id = shift;	# Warp identifier
     my $skycell_id = shift;	# Skycell identifier
+    my $tess_id = shift;	# Tesselation identifier
     my $exit_code = shift;	# Exit code to add
 
     warn($msg);
-    if ($warp_id and $skycell_id and not $no_update) {
-	my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id -code $exit_code";
+    if ($warp_id and $skycell_id and $tess_id and not $no_update) {
+	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);
Index: /trunk/ippScripts/scripts/warp_overlap.pl
===================================================================
--- /trunk/ippScripts/scripts/warp_overlap.pl	(revision 12042)
+++ /trunk/ippScripts/scripts/warp_overlap.pl	(revision 12043)
@@ -16,4 +16,5 @@
 use PS::IPP::Metadata::Config;
 use PS::IPP::Metadata::Stats;
+use PS::IPP::Metadata::List qw( parse_md_list );
 
 use PS::IPP::Config qw(
@@ -84,21 +85,30 @@
 	$imfile->{skycell_id} = 'default';
 	$imfile->{tess_id} = 'default';
+	$imfile->{fault} = 0;
     }
 }
-    
+
+if (defined $workdir) {
+    $workdir = $ipprc->convert_filename_absolute( $workdir );
+} else {
+    my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} );
+    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
+    $workdir = $dir;
+}
 
 # Generate a MDC file with the overlaps
-$workdir = $ipprc->convert_filename_absolute( $workdir );
-my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' ); 
-open my $overlapFile, "> $overlapName" or
-    &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR);
+my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
+open my $overlapFile, "> $overlapName" or die "Unable to open mdc file $overlapName";
 print $overlapFile "warpSkyCellMap MULTI\n\n";
 foreach my $imfile (@$imfiles) {
-    print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n";
-    print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
-    print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
-    print $overlapFile "exp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
-    print $overlapFile "p3_version\tS32\t" . $imfile->{p3_version} . "\n";
-    print $overlapFile "class_id\t\tSTR\t" . $imfile->{class_id} . "\n";
+    print $overlapFile "warpSkyCellMap\tMETADATA\n";
+    print $overlapFile "\twarp_id\tS32\t" . $warp_id . "\n";
+    print $overlapFile "\tskycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
+    print $overlapFile "\ttess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
+    print $overlapFile "\texp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
+    print $overlapFile "\tcam_version\tS32\t" . $imfile->{cam_version} . "\n";
+    print $overlapFile "\tclass_id\t\tSTR\t" . $imfile->{class_id} . "\n";
+    print $overlapFile "\tfault\tS16\t" . $imfile->{fault} . "\n";
+    print $overlapFile "END\n\n";
 }
 close $overlapFile;
@@ -106,5 +116,5 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool
+    my $command = "$warptool -addoverlap -mapfile $overlapName"; # Command to run warptool
     $command .= " -dbname $dbname" if defined $dbname;
 
@@ -129,9 +139,6 @@
 
     warn($msg);
-    if ($warp_id and not $no_update) {
-	my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code";
-	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
-    }
+
+    # No failure option on warptool for this mode, so just die.
     exit $exit_code;
 }
