Index: trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/diff_skycell.pl	(revision 14383)
+++ trunk/ippScripts/scripts/diff_skycell.pl	(revision 14898)
@@ -88,6 +88,6 @@
 
 # Identify the input and the template
-my ($input, $inputMask, $inputWeight, $inputPath); # Input files and path
-my ($template, $templateMask, $templateWeight, $templatePath); # Template files and path
+my ($input, $inputMask, $inputWeight, $inputPath, $inputPSF); # Input files and path
+my ($template, $templateMask, $templateWeight, $templatePath, $templateSources); # Template files and path
 my $tess_id;			# Tesselation identifier
 my $skycell_id;			# Skycell identifier
@@ -100,7 +100,9 @@
 	    $templateMask = "PPSTACK.OUTPUT.MASK";
 	    $templateWeight = "PPSTACK.OUTPUT.WEIGHT";
+	    $templateSources = "PPSTACK.OUTPUT.SOURCES";
 	} else {
 	    $templateMask = "PSWARP.OUTPUT.MASK";
 	    $templateWeight = "PSWARP.OUTPUT.WEIGHT";
+	    $templateSources = "PSWARP.OUTPUT.SOURCES";
 	}
     } else {
@@ -110,7 +112,9 @@
 	    $inputMask = "PPSTACK.OUTPUT.MASK";
 	    $inputWeight = "PPSTACK.OUTPUT.WEIGHT";
+	    die "ppStack doesn't output a PSF model yet.";
 	} else {
 	    $inputMask = "PSWARP.OUTPUT.MASK";
 	    $inputWeight = "PSWARP.OUTPUT.WEIGHT";
+	    $inputPSF = "PSPHOT.PSF.SAVE";
 	}
     }
@@ -144,4 +148,6 @@
 $templateWeight = $ipprc->filename($templateWeight, $templatePath);
 $inputWeight = $ipprc->filename($inputWeight, $inputPath);
+$inputPSF = $ipprc->filename($inputPSF, $inputPath);
+$templateSources = $ipprc->filename($templateSources, $templatePath);
 
 &my_die("Couldn't find input: $template", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($template);
@@ -151,4 +157,6 @@
 &my_die("Couldn't find input: $inputMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);
 &my_die("Couldn't find input: $inputWeight", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputWeight);
+&my_die("Couldn't find input: $inputPSF", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputPSF);
+&my_die("Couldn't find input: $templateSources", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateSources);
 
 # Get the output filenames
@@ -158,4 +166,5 @@
 my $outputMask = $ipprc->filename("PPSUB.OUTPUT.MASK", $outputRoot);
 my $outputWeight = $ipprc->filename("PPSUB.OUTPUT.WEIGHT", $outputRoot);
+my $outputSources = $ipprc->filename("PSPHOT.OUTPUT", $outputRoot);
 #my $bin1Name =  $ipprc->filename("PPSUB.BIN1", $outputRoot);
 #my $bin2Name =  $ipprc->filename("PPSUB.BIN2", $outputRoot);
@@ -177,4 +186,6 @@
     $command .= " -stats $outputStats";
     $command .= " -recipe PPSTATS WARPSTATS";
+    $command .= " -sources $templateSources";
+    $command .= " -psf $inputPSF";
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -187,4 +198,5 @@
     &my_die("Couldn't find expected output file: $outputMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
     &my_die("Couldn't find expected output file: $outputWeight", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
+    &my_die("Couldn't find expected output file: $outputSources", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
 #    &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);
 #    &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
