Index: trunk/ippScripts/scripts/magic_destreak.pl
===================================================================
--- trunk/ippScripts/scripts/magic_destreak.pl	(revision 20822)
+++ trunk/ippScripts/scripts/magic_destreak.pl	(revision 20941)
@@ -90,6 +90,4 @@
 my $magicdstool   = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1);
 my $streaksremove = can_run('streaksremove') or (warn "Can't find streaksremove" and $missing_tools = 1);
-# todo get rid of this dependence on magic_id
-my $magictool   = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1);
 if ($missing_tools) {
     warn("Can't find required tools.");
@@ -124,7 +122,7 @@
 if (index($outroot, "neb://") != 0) {
     if (! -e $outroot ) {
-        mkdir $outroot 
-            or &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 
-                $PS_EXIT_UNKNOWN_ERROR);
+        my $code = system "mkdir -p $outroot";
+        &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 
+                $code >> 8) if $code;
     }
 }
@@ -139,7 +137,7 @@
     if (index($recoveryroot, "neb://") != 0) {
         if (! -e $recoveryroot ) {
-            mkdir $recoveryroot 
-                or &my_die("cannot create output directory $recoveryroot", $magic_ds_id, $component,
-                    $PS_EXIT_UNKNOWN_ERROR);
+            my $code = system "mkdir -p $recoveryroot";
+            &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 
+                    $code >> 8) if $code;
         }
     }
@@ -183,5 +181,5 @@
     $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base);
 } elsif ($stage eq "chip") {
-    $mask   = $ipprc->filename("PSASTRO.OUTPUT.MASK", $path_base, $class_id);
+    $mask   = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
     $weight = $ipprc->filename("PPIMAGE.CHIP.WEIGHT", $path_base, $class_id);
     $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base);
