Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 20338)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 20369)
@@ -64,13 +64,4 @@
 $ipprc->redirect_output($logDest) if $redirect;
 
-# Recipes to use based on reduction class
-# the CHIP recipe should not perform astrometry anymore (2008.04.08)
-
-$reduction = 'DEFAULT' unless defined $reduction;
-my $recipe = $ipprc->reduction($reduction, 'CHIP'); # Recipe to use
-unless ($recipe) {
-    &my_die("Couldn't find selected reduction for CHIP: $reduction\n", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
-}
-
 # Look for programs we need
 my $missing_tools;
@@ -84,4 +75,12 @@
 }
 
+# Recipes to use based on reduction class
+$reduction = 'DEFAULT' unless defined $reduction;
+my $recipe_ppImage = $ipprc->reduction($reduction, 'CHIP_PPIMAGE'); # Recipe to use for ppImage
+my $recipe_psphot  = $ipprc->reduction($reduction, 'CHIP_PSPHOT'); # Recipe to use for psphot
+unless ($recipe_ppImage and $recipe_psphot) {
+    &my_die("Couldn't find selected reduction for CHIP_PPIMAGE and CHIP_PSPHOT: $reduction\n", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
+}
+
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
@@ -120,5 +119,6 @@
     if ($run_state eq "new") {
         $command  = "$ppImage -file $uri $outroot";
-        $command .= " -recipe PPIMAGE $recipe";
+        $command .= " -recipe PPIMAGE $recipe_ppImage";
+        $command .= " -recipe PSPHOT $recipe_psphot";
         $command .= " -threads $threads" if defined $threads;
         $command .= " -dbname $dbname" if defined $dbname;
@@ -147,5 +147,5 @@
 
     ## get the ppImage recipe for this camera and CHIP reduction
-    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe -";
+    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => $verbose);
@@ -177,19 +177,19 @@
 
     if ($do_stats) {
-	my $outputStatsReal = $ipprc->file_resolve($outputStats);
-	&my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;
-
-	# measure chip stats
-	$command = "$ppStatsFromMetadata $outputStatsReal - CHIP_IMFILE";
-	( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	    run(command => $command, verbose => $verbose);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform ppStatsFromMetadata: $error_code", $exp_id, $chip_id, $class_id, $error_code);
-	}
-	foreach my $line (@$stdout_buf) {
-	    $cmdflags .= " $line";
-	}
-	chomp $cmdflags;
+        my $outputStatsReal = $ipprc->file_resolve($outputStats);
+        &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;
+
+        # measure chip stats
+        $command = "$ppStatsFromMetadata $outputStatsReal - CHIP_IMFILE";
+        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+            run(command => $command, verbose => $verbose);
+        unless ($success) {
+            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+            &my_die("Unable to perform ppStatsFromMetadata: $error_code", $exp_id, $chip_id, $class_id, $error_code);
+        }
+        foreach my $line (@$stdout_buf) {
+            $cmdflags .= " $line";
+        }
+        chomp $cmdflags;
     }
 }
Index: trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/diff_skycell.pl	(revision 20338)
+++ trunk/ippScripts/scripts/diff_skycell.pl	(revision 20369)
@@ -27,5 +27,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($diff_id, $dbname, $threads, $outroot, $verbose, $no_update, $no_op, $redirect);
+my ($diff_id, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect);
 GetOptions(
     'diff_id|d=s'       => \$diff_id, # Diff identifier
@@ -33,4 +33,5 @@
     'threads=s'         => \$threads,   # Number of threads to use
     'outroot=s'         => \$outroot, # Output root name
+    'reduction=s'       => \$reduction, # Reduction class
     'verbose'           => \$verbose,   # Print to stdout
     'no-update'         => \$no_update, # Don't update the database?
@@ -60,4 +61,12 @@
     warn("Can't find required tools.");
     exit($PS_EXIT_CONFIG_ERROR);
+}
+
+# Recipes to use based on reduction class
+$reduction = 'DEFAULT' unless defined $reduction;
+my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB'); # Recipe to use for ppSub
+my $recipe_psphot  = $ipprc->reduction($reduction, 'DIFF_PSPHOT'); # Recipe to use for psphot
+unless ($recipe_ppSub and $recipe_psphot) {
+    &my_die("Couldn't find selected reduction for DIFF_PPSUB and DIFF_PSPHOT: $reduction\n", $diff_id, $PS_EXIT_CONFIG_ERROR);
 }
 
@@ -192,4 +201,6 @@
     $command .= " -stats $outputStats";
     $command .= " -threads $threads" if defined $threads;
+    $command .= " -recipe PPSUB $recipe_ppSub";
+    $command .= " -recipe PSPHOT $recipe_psphot";
     $command .= " -recipe PPSTATS WARPSTATS";
     $command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF";
Index: trunk/ippScripts/scripts/stack_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/stack_skycell.pl	(revision 20338)
+++ trunk/ippScripts/scripts/stack_skycell.pl	(revision 20369)
@@ -30,5 +30,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $verbose, $no_update, $no_op, $redirect, $save_temps);
+my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps);
 GetOptions(
     'stack_id|d=s'      => \$stack_id, # Stack identifier
@@ -38,4 +38,5 @@
     'debug'             => \$debug,   # Print to stdout
     'threads=s'         => \$threads,   # Number of threads to use for ppStack
+    'reduction=s'       => \$reduction, # Reduction class
     'verbose'           => \$verbose,   # Print to stdout
     'no-update'         => \$no_update, # Don't update the database?
@@ -74,4 +75,13 @@
     warn("Can't find required tools.");
     exit($PS_EXIT_CONFIG_ERROR);
+}
+
+# Recipes to use based on reduction class
+$reduction = 'DEFAULT' unless defined $reduction;
+my $recipe_ppStack = $ipprc->reduction($reduction, 'STACK_PPSTACK'); # Recipe to use for ppStack
+my $recipe_ppSub = $ipprc->reduction($reduction, 'STACK_PPSUB'); # Recipe to use for ppSub
+my $recipe_psphot  = $ipprc->reduction($reduction, 'STACK_PSPHOT'); # Recipe to use for psphot
+unless ($recipe_ppStack and $recipe_ppSub and $recipe_psphot) {
+    &my_die("Couldn't find selected reduction for STACK_PPSTACK, STACK_PPSUB and STACK_PSPHOT: $reduction\n", $stack_id, $PS_EXIT_CONFIG_ERROR);
 }
 
@@ -188,5 +198,7 @@
     my $command = "$ppStack $listName $outroot";
     $command .= " -stats $outputStats" if $do_stats;;
-    $command .= " -recipe PPSUB STACK";
+    $command .= " -recipe PPSTACK $recipe_ppStack";
+    $command .= " -recipe PPSUB $recipe_ppSub";
+    $command .= " -recipe PSPHOT $recipe_psphot";
     $command .= " -recipe PPSTATS WARPSTATS" if $do_stats;;
     $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE";
