Index: trunk/ippScripts/scripts/warp_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/warp_skycell.pl	(revision 13829)
+++ trunk/ippScripts/scripts/warp_skycell.pl	(revision 13859)
@@ -97,8 +97,8 @@
 my ($list1File, $list1Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.image.list.XXXX", UNLINK => 1);
 my ($list2File, $list2Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.mask.list.XXXX", UNLINK => 1);
-my ($list3File, $list3Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.astrom.list.XXXX", UNLINK => 1);
+my $inputAstrom;
 foreach my $imfile (@$imfiles) {
     my $image = $imfile->{uri};	# Image name
-    my $mask = $ipprc->filename("PPIMAGE.OUTPUT.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
+    my $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
     my $astrom = $ipprc->filename("PSASTRO.OUTPUT.MEF", $imfile->{cam_path_base}); # Astrometry file name
 
@@ -109,9 +109,12 @@
     print $list1File ( $image . "\n");
     print $list2File ( $mask  . "\n");
-    print $list3File ( $astrom  . "\n");
+    if (defined $inputAstrom) {
+	&my_die("Astrometry files don't match: $inputAstrom vs $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $inputAstrom eq $astrom;
+    } else {
+	$inputAstrom = $astrom;
+    }
 }
 close $list1File;
 close $list2File;
-close $list3File;
 
 # Run pswarp
@@ -120,5 +123,5 @@
     my $command = "$pswarp -list $list1Name";
     $command .= " -masklist $list2Name";
-    $command .= " -astromlist $list3Name";
+    $command .= " -astrom $inputAstrom";
     $command .= " $outputRoot $skyFile";
     $command .= " -stats $outputStats";
@@ -142,7 +145,12 @@
     my @contents = <$statsFile>; # Contents of file
     close $statsFile;
-    my $metadata = $mdcParser->parse(join "", @contents)
-        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);
+    my $contents = join "", @contents;
+
+    # Just in case the statistics was impossible to do, e.g., small overlap:
+    if ($contents !~ /^\s*$/) {
+	my $metadata = $mdcParser->parse($contents)
+	    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);
+    }
 }
 
