Index: trunk/ippScripts/scripts/warp_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/warp_imfile.pl	(revision 12013)
+++ trunk/ippScripts/scripts/warp_imfile.pl	(revision 12021)
@@ -32,7 +32,7 @@
 use Pod::Usage qw( pod2usage );
 
-my ($p4_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);
+my ($warp_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);
 GetOptions(
-    'p4_id|i=s'         => \$p4_id, # Phase 4 identifier
+    'warp_id|i=s'       => \$warp_id, # Warp identifier
     'skycell_id|s=s'    => \$skycell_id, # Skycell identifier
     'camera|c=s'        => \$camera, # Camera name
@@ -45,7 +45,7 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --p4_id --skycell_id --camera",
+    -msg => "Required options: --warp_id --skycell_id --camera",
     -exitval => 3,
-) unless defined $p4_id
+) unless defined $warp_id
     and defined $skycell_id
     and defined $camera;
@@ -55,5 +55,5 @@
 # Look for programs we need
 my $missing_tools;
-my $warptool = can_run('p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);
+my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
 my $pswarp = can_run('pswarp') or (warn "Can't find pswarp" and $missing_tools = 1);
 if ($missing_tools) { 
@@ -66,5 +66,5 @@
 my $imfiles;
 {
-    my $command = "$warptool -imfile -p4_id $p4_id -skycell_id $skycell_id";
+    my $command = "$warptool -imfile -warp_id $warp_id -skycell_id $skycell_id";
     $command .= " -dbname $dbname" if defined $dbname;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -72,11 +72,11 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform warptool -imfile: $error_code", $p4_id, $skycell_id, $error_code);
+	&my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $skycell_id, $error_code);
     }
 
     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
-	&my_die("Unable to parse metadata config doc", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     $imfiles = parse_md_list($metadata) or 
-	&my_die("Unable to parse metadata list", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to parse metadata list", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
 }
 
@@ -88,5 +88,5 @@
     $workdir = $dir;
 }
-my $outputFile = "$skycell_id.warp.$p4_id"; # Root name
+my $outputFile = "$skycell_id.warp.$warp_id"; # Root name
 my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
 my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outputRoot, $skycell_id );
@@ -113,10 +113,10 @@
     unless ($success) {
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform pswarp: $error_code", $p4_id, $skycell_id, $error_code);
+	&my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $error_code);
     }
-    &my_die("Couldn't find expected output file: $outputImage", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage;
-    &my_die("Couldn't find expected output file: $outputStats", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
-    &my_die("Couldn't find expected output file: $outputBin1", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
-    &my_die("Couldn't find expected output file: $outputBin2", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
+    &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;
 
     # Get the statistics on the warped image
@@ -126,6 +126,6 @@
     close $statsFile;
     my $metadata = $mdcParser->parse(join "", @contents)
-        or &my_die("Unable to parse metadata config", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
-    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
+        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);
 }
 
@@ -140,5 +140,5 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$warptool -warped -p4_id $p4_id -skycell_id $skycell_id" .
+    my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id" .
 	" -uri $outputImage -b1_uri $outputRoot";  # Command to run dettool
     $command .= " -bg $bg -bg_stdev $bg_stdev";
@@ -159,11 +159,11 @@
 {
     my $msg = shift;		# Warning message on die
-    my $p4_id = shift;		# Phase 4 identifier
+    my $warp_id = shift;	# Warp identifier
     my $skycell_id = shift;	# Skycell identifier
     my $exit_code = shift;	# Exit code to add
 
     warn($msg);
-    if ($p4_id and $skycell_id and not $no_update) {
-	my $command = "$warptool -warped -p4_id $p4_id -skycell_id $skycell_id -code $exit_code";
+    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";
 	$command .= " -dbname $dbname" if defined $dbname;
         system ($command);
