Index: /branches/pap_magic/ippScripts/scripts/diff_skycell.pl
===================================================================
--- /branches/pap_magic/ippScripts/scripts/diff_skycell.pl	(revision 24170)
+++ /branches/pap_magic/ippScripts/scripts/diff_skycell.pl	(revision 24171)
@@ -35,5 +35,5 @@
 }
 
-my ($diff_id, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect);
+my ($diff_id, $dbname, $threads, $outroot, $reduction, $inverse, $verbose, $no_update, $no_op, $redirect);
 my ($skycell_id, $diff_skyfile_id);
 GetOptions(
@@ -44,4 +44,5 @@
     'threads=s'         => \$threads,   # Number of threads to use
     'outroot=s'         => \$outroot, # Output root name
+    'inverse'           => \$inverse, # Make inverse subtraction?
     'reduction=s'       => \$reduction, # Reduction class
     'verbose'           => \$verbose,   # Print to stdout
@@ -96,5 +97,4 @@
 my $camera;                     # Camera
 my ($inputMagic, $templateMagic); # Are the inputs been magicked?
-my $inverse = 1;                # Generate inverse subtraction if warp-warp
 foreach my $file (@$files) {
     if (defined $file->{template} and $file->{template}) {
@@ -107,5 +107,4 @@
             # template is a stack so it doesn't need to be magicked
             $templateMagic = 1;
-            $inverse = 0;
             ## use an explicit stack name for psphot output objects
         } else {
@@ -123,5 +122,4 @@
             $inputVariance = "PPSTACK.OUTPUT.VARIANCE";
             $inputSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
-            $inverse = 0;
         } else {
             $inputMask = "PSWARP.OUTPUT.MASK";
Index: /branches/pap_magic/ippTasks/diff.pro
===================================================================
--- /branches/pap_magic/ippTasks/diff.pro	(revision 24170)
+++ /branches/pap_magic/ippTasks/diff.pro	(revision 24171)
@@ -146,4 +146,5 @@
     book getword diffSkyfile $pageName skycell_id -var SKYCELL_ID
     book getword diffSkyfile $pageName camera -var CAMERA
+    book getword diffSkyfile $pageName inverse -var INVERSE
     book getword diffSkyfile $pageName workdir -var WORKDIR_TEMPLATE
     book getword diffSkyfile $pageName dbname -var DBNAME
@@ -164,4 +165,7 @@
 
     $run = diff_skycell.pl --threads @MAX_THREADS@ --diff_id $DIFF_ID --skycell_id $SKYCELL_ID --diff_skyfile_id $DIFF_SKYFILE_ID --outroot $outroot --redirect-output
+    if ($INVERSE > 1)
+       $run = $run --inverse
+    end
     add_standard_args run
 
Index: /branches/pap_magic/ippTools/share/difftool_todiffskyfile.sql
===================================================================
--- /branches/pap_magic/ippTools/share/difftool_todiffskyfile.sql	(revision 24170)
+++ /branches/pap_magic/ippTools/share/difftool_todiffskyfile.sql	(revision 24171)
@@ -9,5 +9,6 @@
     diffRun.tess_id,
     diffRun.label,
-    diffRun.state
+    diffRun.state,
+    diffRun.inverse
 FROM diffRun
 JOIN diffInputSkyfile USING(diff_id)
