Index: trunk/ippScripts/scripts/magic_destreak_revert.pl
===================================================================
--- trunk/ippScripts/scripts/magic_destreak_revert.pl	(revision 27014)
+++ trunk/ippScripts/scripts/magic_destreak_revert.pl	(revision 27015)
@@ -36,5 +36,5 @@
 
 # Parse the command-line arguments
-my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $inverse, $cam_path_base);
+my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base);
 my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum);
 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
@@ -51,4 +51,5 @@
            'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels
            'replace=s'      => \$replace,    # replace the input images with the results.
+           'bothways=s'     => \$bothways,   # run has inverse files (bothways diff)
            'save-temps'     => \$save_temps, # Save temporary files?
            'dbname=s'       => \$dbname,     # Database name
@@ -193,5 +194,5 @@
 revert_files($replace, $image, $mask, $weight, $sources, $astrom, $bimage, $bmask, $bweight, $bsources, $bastrom);
 
-if ($stage eq "diff" and $inverse) {
+if ($stage eq "diff" and $bothways) {
     my $name = "PPSUB.INVERSE";
     $image  = $ipprc->filename($name, $path_base);
Index: trunk/ippTasks/destreak.pro
===================================================================
--- trunk/ippTasks/destreak.pro	(revision 27014)
+++ trunk/ippTasks/destreak.pro	(revision 27015)
@@ -411,4 +411,5 @@
 #    book getword magicDSToRevert $pageName recoveryroot -var RECROOT
     book getword magicDSToRevert $pageName re_place -var REPLACE
+    book getword magicDSToRevert $pageName bothways -var BOTHWAYS
     book getword magicDSToRevert $pageName dbname -var DBNAME
 
@@ -423,5 +424,5 @@
     end
 
-    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --outroot $OUTROOT --logfile $logfile --replace $REPLACE
+    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS
 
     add_standard_args run
Index: trunk/ippTools/share/magicdstool_torevert_camera.sql
===================================================================
--- trunk/ippTools/share/magicdstool_torevert_camera.sql	(revision 27014)
+++ trunk/ippTools/share/magicdstool_torevert_camera.sql	(revision 27015)
@@ -11,4 +11,5 @@
     camProcessedExp.path_base,
     camProcessedExp.path_base AS cam_path_base,
+    0 AS bothways,
     0 AS bytes,
     0 AS md5sum
Index: trunk/ippTools/share/magicdstool_torevert_chip.sql
===================================================================
--- trunk/ippTools/share/magicdstool_torevert_chip.sql	(revision 27014)
+++ trunk/ippTools/share/magicdstool_torevert_chip.sql	(revision 27015)
@@ -11,4 +11,5 @@
     chipProcessedImfile.path_base,
     camProcessedExp.path_base AS cam_path_base,
+    0 AS bothways,
     0 AS bytes,
     0 AS md5sum
Index: trunk/ippTools/share/magicdstool_torevert_diff.sql
===================================================================
--- trunk/ippTools/share/magicdstool_torevert_diff.sql	(revision 27014)
+++ trunk/ippTools/share/magicdstool_torevert_diff.sql	(revision 27015)
@@ -11,4 +11,5 @@
     diffSkyfile.path_base,
     "NULL" AS cam_path_base,
+    CAST(diffRun.bothways AS SIGNED) AS bothways,
     0 AS bytes,
     0 AS md5sum
@@ -17,4 +18,5 @@
     JOIN magicDSFile USING(magic_ds_id)
     JOIN diffSkyfile ON (stage_id = diffSkyfile.diff_id AND component = skycell_id)
+    JOIN diffRun ON diffSkyfile.diff_id = diffRun.diff_id
     JOIN rawExp USING(exp_id)
 WHERE magicDSRun.stage = 'diff'
Index: trunk/ippTools/share/magicdstool_torevert_raw.sql
===================================================================
--- trunk/ippTools/share/magicdstool_torevert_raw.sql	(revision 27014)
+++ trunk/ippTools/share/magicdstool_torevert_raw.sql	(revision 27015)
@@ -11,4 +11,5 @@
     rawImfile.uri AS path_base,
     NULL AS cam_path_base,
+    0 AS bothways,
     bytes,
     md5sum
Index: trunk/ippTools/share/magicdstool_torevert_warp.sql
===================================================================
--- trunk/ippTools/share/magicdstool_torevert_warp.sql	(revision 27014)
+++ trunk/ippTools/share/magicdstool_torevert_warp.sql	(revision 27015)
@@ -11,4 +11,5 @@
     warpSkyfile.path_base,
     "NULL" AS cam_path_base,
+    0 AS bothways,
     0 AS bytes,
     0 AS md5sum
