Index: trunk/ippScripts/scripts/sc_prepare_diff.pl
===================================================================
--- trunk/ippScripts/scripts/sc_prepare_diff.pl	(revision 38096)
+++ trunk/ippScripts/scripts/sc_prepare_diff.pl	(revision 38097)
@@ -59,5 +59,5 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
-my @return_component_list = ("DBINFO.EXP", "PPSUB.CONFIG", "LOG.EXP",
+my @return_component_list = ("DBINFO.EXP", "PPSUB.CONFIG", "LOG.EXP","TRACE.EXP","SKYCELL.STATS","PPSUB.OUTPUT.KERNELS",
 			     "PPSUB.OUTPUT.SOURCES", "PPSUB.INVERSE.SOURCES",
 			     "PSPHOT.BACKMDL.MEF", "PSPHOT.PSF.SKY.SAVE");
@@ -145,10 +145,10 @@
 
 
-    my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB');
-    my $recipe_psphot= $ipprc->reduction($reduction, 'DIFF_PSPHOT');
+#    my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB');
+#    my $recipe_psphot= $ipprc->reduction($reduction, 'DIFF_PSPHOT');
 #    my $recipe_ppstats= 'DIFFSTATS';
-    &my_die("Unable to find recipes for reduction $reduction",
-	    $remote_id, $diff_id, $PS_EXIT_CONFIG_ERROR, $fail_state) 
-	unless ((defined($recipe_ppSub))&&(defined($recipe_psphot)));
+#     &my_die("Unable to find recipes for reduction $reduction",
+# 	    $remote_id, $diff_id, $PS_EXIT_CONFIG_ERROR, $fail_state) 
+# 	unless ((defined($recipe_ppSub))&&(defined($recipe_psphot)));
 
 
@@ -197,7 +197,13 @@
 	my $remote_templwt    = &uri_local_to_remote($ipp_templwt);
 	my $remote_templsourc = &uri_local_to_remote($ipp_templsourc);
-
-
-	# Conver these here
+	
+	my $pre_command     = " sc_check_diff.pl --diff_id ${diff_id} --skycell_id ${skycell_id} --dbname ${dbname} --out_path_base ${remote_outroot} $remote_inimage $remote_inmask $remote_inwt $remote_insourc $remote_templimage $remote_templmask $remote_templwt $remote_templsourc ";
+
+	# make any directory we may need
+        my $remote_outroot_dir = dirname($remote_outroot);
+        my $dir_command =  "mkdir -p $remote_outroot_dir";
+
+
+	# Convert these here
         my $psdiff_command  = " ppSub ${remote_outroot} ";
         $psdiff_command    .= " -inimage $remote_inimage -refimage $remote_templimage ";
@@ -208,6 +214,6 @@
         $psdiff_command    .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF ";
         $psdiff_command    .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF ";
-        $psdiff_command    .= " -recipe PPSUB $recipe_ppSub ";
-        $psdiff_command    .= " -recipe PSPHOT $recipe_psphot ";
+        $psdiff_command    .= " -recipe PPSUB WARPSTACK_PV3 ";
+        $psdiff_command    .= " -recipe PSPHOT DIFF_PV3 ";
         $psdiff_command    .= " -recipe PPSTATS DIFFSTATS ";
         $psdiff_command    .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
@@ -215,5 +221,5 @@
         $psdiff_command    .= " -recipe PPSTATS DIFFSTATS ";
         $psdiff_command    .= " -dumpconfig ${remote_outroot}.ppSub.mdc -stats ${remote_outroot}.stats ";
-	$psdiff_command    .= " -save-inconv "; # I guess?
+#	$psdiff_command    .= " -save-inconv "; # I guess? Nope.  It makes images we don't plan to transfer back.
 	$psdiff_command    .= " -photometry -inverse ";
 	$psdiff_command    .= " -image_id $diff_skyfile_id "; # I have no clue what this does.
@@ -228,5 +234,5 @@
         my $post_cmd_SfM  = " ppStatsFromMetadata ${remote_outroot}.stats - DIFF_SKYCELL >> ${remote_outroot}.dbinfo ";
 
-        print CONFIG " ${psdiff_command} && ${post_cmd_echo} && ${post_cmd_SfM} ";
+        print CONFIG " ${dir_command} && ${pre_command} && ${psdiff_command} && ${post_cmd_echo} && ${post_cmd_SfM} ";
         $job_index++;
 
