Index: trunk/ippTasks/detrend.norm.pro
===================================================================
--- trunk/ippTasks/detrend.norm.pro	(revision 12126)
+++ trunk/ippTasks/detrend.norm.pro	(revision 12368)
@@ -164,7 +164,9 @@
     end
 
-    # XXX add $WORKDIR/$LOG_DIR
-    # XXX use ipp_filename.pl to lookup output file names
-    $outroot = `ipp_datapath.pl $WORKDIR`
+    if ($WORKDIR == NULL)
+      $outroot = `pwd`
+    else
+      $outroot = `ipp_datapath.pl $WORKDIR`
+    end
     $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     $logfile = $outroot/norm.$DET_ID.$ITERATION.log
@@ -178,7 +180,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE $ARGS
-    end
-    command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE $ARGS
+      echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --workdir $outroot $ARGS
+    end
+    command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --workdir $outroot $ARGS
   end
 
@@ -280,5 +282,9 @@
 
     # XXX use ipp_filename.pl to lookup output file names
-    $outroot = `ipp_datapath.pl $WORKDIR`
+    if ($WORKDIR == NULL)
+      $outroot = `pwd`
+    else
+      $outroot = `ipp_datapath.pl $WORKDIR`
+    end
     $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     $logfile = $outroot/norm.$DET_ID.$ITERATION.$CLASS_ID.log
@@ -292,7 +298,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE $ARGS
-    end
-    command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE $ARGS
+      echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE --workdir $outroot $ARGS
+    end
+    command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE --workdir $outroot $ARGS
   end
 
@@ -391,5 +397,9 @@
 
     # XXX add $WORKDIR/$LOG_DIR
-    $outroot = `ipp_datapath.pl $WORKDIR`
+    if ($WORKDIR == NULL)
+      $outroot = `pwd`
+    else
+      $outroot = `ipp_datapath.pl $WORKDIR`
+    end
     $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     $logfile = $outroot/norm.$DET_ID.$ITERATION.log
@@ -403,7 +413,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE $ARGS
-    end
-    command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE $ARGS
+      echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE --workdir $outroot $ARGS
+    end
+    command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE --workdir $outroot $ARGS
   end
 
