Index: /tags/ipp-20110622/ippScripts/scripts/warp_skycell.pl
===================================================================
--- /tags/ipp-20110622/ippScripts/scripts/warp_skycell.pl	(revision 32469)
+++ /tags/ipp-20110622/ippScripts/scripts/warp_skycell.pl	(revision 32470)
@@ -38,4 +38,5 @@
 
 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
@@ -74,9 +75,9 @@
 my $do_stats;
 if ($run_state eq 'new') {
-    $logDest = prepare_output("LOG.EXP", $outroot, $skycell_id, 0);
+    $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id);
     $traceDest = prepare_output("TRACE.EXP", $outroot, $skycell_id, 1);
     $do_stats = 1;
 } elsif ($run_state eq 'update')  {
-    $logDest = prepare_output("LOG.EXP.UPDATE", $outroot, $skycell_id, 1);
+    $logDest = $ipprc->filename("LOG.EXP.UPDATE", $outroot, $skycell_id);
     $traceDest = prepare_output("TRACE.EXP.UPDATE", $outroot, $skycell_id, 1);
 } else {
@@ -90,5 +91,5 @@
 }
 
-$ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ) if $redirect;
+$ipprc->redirect_to_logfile($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
@@ -330,5 +331,5 @@
             }
         }
-
+	print "Quality: $quality\n";
         unless ($no_update) {
             # XXX change -tess_id to -tess_dir when db is updated
@@ -355,4 +356,19 @@
         }
     } else {
+
+	my $quality = 0;
+
+	unless ($ipprc->file_exists($outputPSF)) {
+	    $quality = 8006; # bad data.
+	}
+#         if (!$quality) {
+#             check_output($outputImage, 0);
+#             check_output($outputMask, 0);
+#             check_output($outputWeight, 0);
+#             check_output($outputSources, 1);
+#             check_output($outputPSF, 1) if metadataLookupBool($recipe, 'PSF')  ;
+#         }
+	print "Quality: $quality\n";
+
         # $run_state eq 'update'
         unless ($no_update) {
@@ -361,4 +377,5 @@
             $command .= " -skycell_id $skycell_id";
             $command .= " -set_magicked $magicked" if $magicked;
+	    $command .= " -set_quality $quality" if $quality;
             $command .= " -dbname $dbname"   if defined $dbname;
 
Index: /tags/ipp-20110622/ippTools/src/warptool.c
===================================================================
--- /tags/ipp-20110622/ippTools/src/warptool.c	(revision 32469)
+++ /tags/ipp-20110622/ippTools/src/warptool.c	(revision 32470)
@@ -2051,8 +2051,12 @@
         // magicked is only an argument for for -tofullskyfile
         PXOPT_LOOKUP_S64(magicked, config->args, "-set_magicked", false, false);
+	PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false);
         if (magicked) {
             psStringAppend(&set_magicked_skyfile, "\n , warpSkyfile.magicked = %" PRId64, magicked);
             psStringAppend(&set_magicked_run, "\n,  warpRun.magicked = %" PRId64, magicked);
         }
+	if (quality) {
+	  psStringAppend(&set_magicked_skyfile, "\n , warpSkyfile.quality = %"PRId16, quality);
+	}
     } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) {
         // if magicked is currently nonzero set it to -1
Index: /tags/ipp-20110622/ippTools/src/warptoolConfig.c
===================================================================
--- /tags/ipp-20110622/ippTools/src/warptoolConfig.c	(revision 32469)
+++ /tags/ipp-20110622/ippTools/src/warptoolConfig.c	(revision 32470)
@@ -398,5 +398,6 @@
     psMetadataAddStr(tofullskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "skycell ID to update", NULL);
     psMetadataAddS64(tofullskyfileArgs, PS_LIST_TAIL, "-set_magicked",  0, "new value for magicked", 0);
-
+    psMetadataAddS16(tofullskyfileArgs, PS_LIST_TAIL, "-set_quality", 0, "new value for quality", 0);
+    
     // -updateskyfile
     psMetadata *updateskyfileArgs = psMetadataAlloc();
