Index: trunk/ippScripts/scripts/magic_destreak.pl
===================================================================
--- trunk/ippScripts/scripts/magic_destreak.pl	(revision 27957)
+++ trunk/ippScripts/scripts/magic_destreak.pl	(revision 28536)
@@ -97,8 +97,8 @@
 my ($skycell_args, $class_id, $skycell_id);
 
-if (($stage eq "raw") or ($stage eq "chip")) {
+if (($stage eq "raw") or ($stage eq "chip") or $stage eq "chip_bg") {
     $class_id = $component;
     $skycell_args = " -class_id $component";
-} elsif ($stage eq "warp") {
+} elsif ($stage eq "warp" or $stage eq "warp_bg") {
     $skycell_id = $component;
     $skycell_args = " -skycell_id $component";
@@ -286,5 +286,9 @@
         # $sources = $ipprc->filename("PSPHOT.OUT.CMF.SPL",  $path_base);
 
-    } elsif ($stage eq "warp") {
+    } elsif ($stage eq "chip_bg") {
+        $image  = $ipprc->filename("PPBACKGROUND.OUTPUT", $path_base, $class_id);
+        $mask = $ipprc->filename("PPBACKGROUND.OUTPUT.MASK", $path_base, $class_id);
+        $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base);
+    } elsif ($stage eq "warp" or $stage eq "warp_bg") {
         $image  = $ipprc->filename("PSWARP.OUTPUT", $path_base);
         $mask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base);
