Index: trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/diff_skycell.pl	(revision 14246)
+++ trunk/ippScripts/scripts/diff_skycell.pl	(revision 14258)
@@ -88,6 +88,6 @@
 
 # Identify the input and the template
-my ($input, $inputPath);	# Input file and path
-my ($template, $templatePath);	# Template file and path
+my ($input, $inputMask, $inputPath); # Input file and path
+my ($template, $templateMask, $templatePath); # Template file and path
 my $tess_id;			# Tesselation identifier
 my $skycell_id;			# Skycell identifier
@@ -97,7 +97,17 @@
 	$template = $file->{uri};
 	$templatePath = $file->{path_base};
+	if ($file->{warp_id} == 0) {
+	    $templateMask = "PPSTACK.OUTPUT.MASK";
+	} else {
+	    $templateMask = "PSWARP.OUTPUT.MASK";
+	}
     } else {
 	$input = $file->{uri};
 	$inputPath = $file->{path_base};
+	if ($file->{warp_id} == 0) {
+	    $inputMask = "PPSTACK.OUTPUT.MASK";
+	} else {
+	    $inputMask = "PSWARP.OUTPUT.MASK";
+	}
     }
     if (defined $tess_id) {
@@ -118,4 +128,5 @@
 	$camera = $file->{camera};
     }
+
 }
 
@@ -125,6 +136,6 @@
 $ipprc->define_camera($camera);
 
-my $templateMask = $ipprc->filename("PSWARP.OUTPUT.MASK", $templatePath);
-my $inputMask = $ipprc->filename("PSWARP.OUTPUT.MASK", $inputPath);
+$templateMask = $ipprc->filename($templateMask, $templatePath);
+$inputMask = $ipprc->filename($inputMask, $inputPath);
 
 &my_die("Couldn't find input: $template", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($template);
