Index: trunk/ippScripts/scripts/magic_destreak.pl
===================================================================
--- trunk/ippScripts/scripts/magic_destreak.pl	(revision 20791)
+++ trunk/ippScripts/scripts/magic_destreak.pl	(revision 20822)
@@ -121,4 +121,13 @@
 }
 
+# create the output directories if it is not a nebulous path and it doesn't exist
+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 $backup_path_base;
 if (! $remove) {
@@ -128,4 +137,11 @@
 my $recovery_path_base;
 if ($recoveryroot) {
+    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);
+        }
+    }
     $recovery_path_base = "$recoveryroot/$basename";
 }
@@ -183,7 +199,6 @@
     $command .= " -recovery $recoveryroot" if defined $recoveryroot;
     $command .= " -astrom $astrom" if defined $astrom;
-    # XXX: remove this   skip mask and weight images for now
-#    $command .= " -mask $mask" if defined $mask;
-#    $command .= " -weight $weight" if defined $weight;
+    $command .= " -mask $mask" if defined $mask;
+    $command .= " -weight $weight" if defined $weight;
     $command .= " -skycelllist $skycell_list" if defined $skycell_list;
     $command .= " -dbname $dbname" if defined $dbname;
