Index: /trunk/dbconfig/changes.txt
===================================================================
--- /trunk/dbconfig/changes.txt	(revision 24486)
+++ /trunk/dbconfig/changes.txt	(revision 24487)
@@ -1126,2 +1126,4 @@
 
 -- Version 1.1.53
+
+ALTER TABLE warpRun ADD COLUMN reduction VARCHAR(64) AFTER tess_id;
Index: /trunk/dbconfig/warp.md
===================================================================
--- /trunk/dbconfig/warp.md	(revision 24486)
+++ /trunk/dbconfig/warp.md	(revision 24487)
@@ -19,4 +19,5 @@
     dvodb       STR         255
     tess_id     STR         64
+    reduction	STR	    64
     end_stage   STR         64      # Key
     registered  TAI         NULL
Index: /trunk/ippScripts/scripts/warp_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/warp_skycell.pl	(revision 24486)
+++ /trunk/ippScripts/scripts/warp_skycell.pl	(revision 24487)
@@ -36,5 +36,5 @@
 }
 
-my ($warp_id, $skycell_id, $warp_skyfile_id, $tess_dir, $camera, $dbname, $outroot, $threads, $run_state, $magicked, $verbose, $no_update, $no_op, $redirect, $save_temps);
+my ($warp_id, $skycell_id, $warp_skyfile_id, $tess_dir, $reduction, $camera, $dbname, $outroot, $threads, $run_state, $magicked, $verbose, $no_update, $no_op, $redirect, $save_temps);
 GetOptions(
     'warp_id|i=s'         => \$warp_id, # Warp identifier
@@ -44,4 +44,5 @@
     'camera|c=s'          => \$camera, # Camera name
     'dbname|d=s'          => \$dbname, # Database name
+    'reduction=s'         => \$reduction, # Reduction class
     'outroot=s'           => \$outroot, # Output root name
     'threads=s'           => \$threads,   # Number of threads to use for pswarp
@@ -73,4 +74,11 @@
 
 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ) if $redirect;
+
+# Recipes to use based on reduction class
+$reduction = 'DEFAULT' unless defined $reduction;
+my $recipe_pswarp = $ipprc->reduction($reduction, 'WARP_PSWARP'); # Recipe to use for ppImage
+unless ($recipe_pswarp) {
+    &my_die("Couldn't find selected reduction for WARP_PSWARP: $reduction\n", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR);
+}
 
 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_WARP);
@@ -102,5 +110,5 @@
 my $astromSource;               # The astrometry source
 {
-    my $command = "$ppConfigDump -camera $camera -dump-recipe PSWARP -";
+    my $command = "$ppConfigDump -camera $camera -recipe PSWARP $recipe_pswarp -dump-recipe PSWARP -";
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => $verbose);
@@ -192,4 +200,5 @@
     $command .= " -F SOURCE.PLOT.PSFMODEL SOURCE.PLOT.SKY.PSFMODEL";
     $command .= " -F SOURCE.PLOT.APRESID SOURCE.PLOT.SKY.APRESID";
+    $command .= " -recipe PSWARP $recipe_pswarp";
     $command .= " -psf";        # Turn on PSF determination
     $command .= " -tracedest $traceDest -log $logDest";
Index: /trunk/ippTasks/warp.pro
===================================================================
--- /trunk/ippTasks/warp.pro	(revision 24486)
+++ /trunk/ippTasks/warp.pro	(revision 24487)
@@ -297,4 +297,5 @@
     # XXX change tess_id to tess_dir when schema is changed
     book getword warpPendingSkyCell $pageName tess_id -var TESS_DIR
+    book getword warpPendingSkyCell $pageName reduction -var REDUCTION
     book getword warpPendingSkyCell $pageName exp_tag -var EXP_TAG
     book getword warpPendingSkyCell $pageName state -var RUN_STATE
@@ -317,5 +318,5 @@
     stderr $LOGDIR/warp.skycell.log
 
-    $run = warp_skycell.pl --threads @MAX_THREADS@ --warp_id $WARP_ID --warp_skyfile_id $WARP_SKYFILE_ID --skycell_id $SKYCELL_ID --tess_dir $TESS_DIR --camera $CAMERA --outroot $outroot --redirect-output --run-state $RUN_STATE $MAGICKED_ARG
+    $run = warp_skycell.pl --threads @MAX_THREADS@ --warp_id $WARP_ID --warp_skyfile_id $WARP_SKYFILE_ID --skycell_id $SKYCELL_ID --tess_dir $TESS_DIR --reduction $REDUCTION --camera $CAMERA --outroot $outroot --redirect-output --run-state $RUN_STATE $MAGICKED_ARG
     add_standard_args run
 
Index: /trunk/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- /trunk/ippTools/share/pxadmin_create_tables.sql	(revision 24486)
+++ /trunk/ippTools/share/pxadmin_create_tables.sql	(revision 24487)
@@ -794,4 +794,5 @@
     dvodb VARCHAR(255),
     tess_id VARCHAR(64),
+    reduction VARCHAR(64),
     end_stage VARCHAR(64),
     registered DATETIME,
Index: /trunk/ippTools/share/warptool_towarped.sql
===================================================================
--- /trunk/ippTools/share/warptool_towarped.sql	(revision 24486)
+++ /trunk/ippTools/share/warptool_towarped.sql	(revision 24487)
@@ -6,4 +6,5 @@
     warpRun.fake_id,
     warpRun.state,
+    warpRun.reduction,
     camRun.cam_id,
     rawExp.camera,
Index: /trunk/ippTools/src/faketool.c
===================================================================
--- /trunk/ippTools/src/faketool.c	(revision 24486)
+++ /trunk/ippTools/src/faketool.c	(revision 24487)
@@ -235,8 +235,8 @@
         bool status;
         char *end_stage = psMetadataLookupStr(&status, md, "end_stage");
-	if (end_stage && strcasecmp(end_stage, "warp")) continue;
+        if (end_stage && strcasecmp(end_stage, "warp")) continue;
 
         char *raw_tess_id   = psMetadataLookupStr(&status, md, "tess_id");
-	if (raw_tess_id || tess_id) continue;
+        if (raw_tess_id || tess_id) continue;
 
         char *label  = psMetadataLookupStr(&status, md, "label");
@@ -244,5 +244,5 @@
 
         if (!status) {
-	    psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id);
+            psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id);
             psFree(output);
             return false;
@@ -1157,10 +1157,11 @@
         // pxwarpQueueByFakeID() can only be run after fakeRun.state has been set to stop
         if (!pxwarpQueueByFakeID(config,
-                    fakeRun->fake_id,
-                    fakeRun->workdir,
-                    fakeRun->label,
-                    fakeRun->dvodb,
-                    fakeRun->tess_id,
-                    fakeRun->end_stage
+                                 fakeRun->fake_id,
+                                 fakeRun->workdir,
+                                 fakeRun->label,
+                                 fakeRun->dvodb,
+                                 fakeRun->tess_id,
+                                 fakeRun->reduction,
+                                 fakeRun->end_stage
         )) {
             psError(PS_ERR_UNKNOWN, false, "failed to queue warpRun");
Index: /trunk/ippTools/src/pxwarp.c
===================================================================
--- /trunk/ippTools/src/pxwarp.c	(revision 24486)
+++ /trunk/ippTools/src/pxwarp.c	(revision 24487)
@@ -126,10 +126,11 @@
 
 bool pxwarpQueueByFakeID(pxConfig *config,
-                    psS64 fake_id,
-                    char *workdir,
-                    char *label,
-                    char *dvodb,
-                    char *tess_id,
-                    char *end_stage)
+                         psS64 fake_id,
+                         const char *workdir,
+                         const char *label,
+                         const char *dvodb,
+                         const char *tess_id,
+                         const char *reduction,
+                         const char *end_stage)
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
@@ -146,4 +147,5 @@
         dvodb,
         tess_id,
+                       reduction,
         end_stage,
         NULL,      // registered
Index: /trunk/ippTools/src/pxwarp.h
===================================================================
--- /trunk/ippTools/src/pxwarp.h	(revision 24486)
+++ /trunk/ippTools/src/pxwarp.h	(revision 24487)
@@ -31,10 +31,11 @@
 
 bool pxwarpQueueByFakeID(pxConfig *config,
-                    psS64 fake_id,
-                    char *workdir,
-                    char *label,
-                    char *dvodb,
-                    char *tess_id,
-                    char *end_stage);
+                         psS64 fake_id,
+                         const char *workdir,
+                         const char *label,
+                         const char *dvodb,
+                         const char *tess_id,
+                         const char *reduction,
+                         const char *end_stage);
 
 #endif // PXWARP_H
Index: /trunk/ippTools/src/warptool.c
===================================================================
--- /trunk/ippTools/src/warptool.c	(revision 24486)
+++ /trunk/ippTools/src/warptool.c	(revision 24487)
@@ -139,4 +139,5 @@
     PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
     PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); // required (no default TESS)
+    PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); // required (no default TESS)
     PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false);
     PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
@@ -159,4 +160,5 @@
             dvodb,
             tess_id,
+            reduction,
             end_stage,
             registered,
@@ -249,4 +251,5 @@
     PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false);
     PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
+    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
     PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
 
@@ -332,10 +335,11 @@
         // queue the exp
         if (!pxwarpQueueByFakeID(config,
-                    row->fake_id,
-                    workdir     ? workdir   : row->workdir,
-                    label       ? label     : row->label,
-                    dvodb       ? dvodb     : row->dvodb,
-                    tess_id     ? tess_id   : row->tess_id,
-                    end_stage   ? end_stage : row->end_stage))
+                                 row->fake_id,
+                                 workdir     ? workdir   : row->workdir,
+                                 label       ? label     : row->label,
+                                 dvodb       ? dvodb     : row->dvodb,
+                                 tess_id     ? tess_id   : row->tess_id,
+                                 reduction   ? reduction : row->reduction,
+                                 end_stage   ? end_stage : row->end_stage))
           {
             psError(PS_ERR_UNKNOWN, false, "failed to trying to queue fake_id: %" PRId64, row->fake_id);
Index: /trunk/ippTools/src/warptoolConfig.c
===================================================================
--- /trunk/ippTools/src/warptoolConfig.c	(revision 24486)
+++ /trunk/ippTools/src/warptoolConfig.c	(revision 24487)
@@ -98,4 +98,5 @@
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_dvodb",          0, "define DVO db", NULL);
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_tess_id",        0, "define tess ID", NULL);
+    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_reduction",      0, "define reduction class", NULL);
     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_end_stage",      0, "define end stage", NULL);
     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-all",               0, "allow everything to be queued without search terms", false);
@@ -111,5 +112,6 @@
     psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", 0,            "define label", NULL);
     psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-dvodb", 0,            "define dvodb", NULL);
-    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-tess_id", 0,            "define tess_id", NULL);
+    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-tess_id", 0,            "define tess_id (required)", NULL);
+    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-reduction", 0,            "define reduction class", NULL);
     psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-end_stage", 0,            "define end stage", NULL);
     psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-registered",  0,            "time detrend run was registered", now);
Index: /trunk/ippconfig/recipes/filerules-split.mdc
===================================================================
--- /trunk/ippconfig/recipes/filerules-split.mdc	(revision 24486)
+++ /trunk/ippconfig/recipes/filerules-split.mdc	(revision 24487)
@@ -226,5 +226,5 @@
 PPSTAMP.CHIP            OUTPUT {OUTPUT}.ch.fits                  IMAGE     NONE       CHIP       FALSE     MEF
 		        									        
-PPSIM.OUTPUT            OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE     NONE       CHIP       TRUE      NONE
+PPSIM.OUTPUT            OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE     NONE       CHIP       TRUE      SPLIT
 PPSIM.FAKE.CHIP        	OUTPUT {OUTPUT}.{CHIP.NAME}.fake.fits    IMAGE     NONE       CHIP       TRUE      NONE
 PPSIM.FORCE.CHIP       	OUTPUT {OUTPUT}.{CHIP.NAME}.force.fits   IMAGE     NONE       CHIP       TRUE      NONE
Index: /trunk/ippconfig/recipes/pswarp.config
===================================================================
--- /trunk/ippconfig/recipes/pswarp.config	(revision 24486)
+++ /trunk/ippconfig/recipes/pswarp.config	(revision 24487)
@@ -10,2 +10,6 @@
 ACCEPT.FRAC		F32	0.1		# Minimum fraction of good pixels to accept result
 INTERPOLATION.NUM	S32	1000		# Number of interpolation kernels to pre-calculate
+
+# Default recipe for warping
+WARP	METADATA
+END
Index: /trunk/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- /trunk/ippconfig/recipes/reductionClasses.mdc	(revision 24486)
+++ /trunk/ippconfig/recipes/reductionClasses.mdc	(revision 24487)
@@ -130,4 +130,5 @@
 	CHIP_PPIMAGE	STR	CHIP
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -146,4 +147,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_P
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -162,4 +164,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_FLATCORR
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -178,4 +181,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_FLATTEST
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -194,4 +198,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_DET_ONLY
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -208,4 +213,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_OBDSF
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -223,4 +229,5 @@
 	CHIP_PPIMAGE	STR	PPIMAGE_MASKPHOT
 	CHIP_PSPHOT	STR	CHIP
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	STACK
 	STACK_PPSUB	STR	STACK
@@ -238,22 +245,13 @@
 	CHIP_PPIMAGE	STR	CHIP_DENSE_STARS
 	CHIP_PSPHOT	STR	CHIP
-	STACK_PPSTACK	STR	STACK
-	STACK_PPSUB	STR	STACK
-	STACK_PSPHOT	STR	STACK
-	DIFF_PPSUB	STR	DIFF
-	DIFF_PSPHOT	STR	DIFF
-	JPEG_BIN1	STR	PPIMAGE_J1
-	JPEG_BIN2	STR	PPIMAGE_J2
-	FAKEPHOT	STR	FAKEPHOT
-	ADDSTAR		STR	ADDSTAR
-	PSASTRO		STR	DEFAULT_RECIPE
-END
-
-# Intended for areas with high stellar density
-WARPWARP	METADATA
-	DIFF_PPSUB	STR	WARPWARP
-	DIFF_PSPHOT	STR	DIFF
-	JPEG_BIN1	STR	PPIMAGE_J1
-	JPEG_BIN2	STR	PPIMAGE_J2
+	WARP_PSWARP	STR	WARP
+	STACK_PPSTACK	STR	STACK
+	STACK_PPSUB	STR	STACK
+	STACK_PSPHOT	STR	STACK
+	DIFF_PPSUB	STR	DIFF
+	DIFF_PSPHOT	STR	DIFF
+	JPEG_BIN1	STR	PPIMAGE_J1
+	JPEG_BIN2	STR	PPIMAGE_J2
+	FAKEPHOT	STR	FAKEPHOT
 	ADDSTAR		STR	ADDSTAR
 	PSASTRO		STR	DEFAULT_RECIPE
@@ -265,4 +263,5 @@
 	CHIP_PPIMAGE  	STR	CHIP
 	CHIP_PSPHOT	STR	PR
+	WARP_PSWARP	STR	WARP
 	STACK_PPSTACK	STR	PR
 	STACK_PPSUB	STR	PR
