Index: trunk/ippTasks/detrend.process.pro
===================================================================
--- trunk/ippTasks/detrend.process.pro	(revision 12361)
+++ trunk/ippTasks/detrend.process.pro	(revision 12368)
@@ -154,5 +154,9 @@
 
     ## output log filename
-    $outroot = `ipp_datapath.pl $WORKDIR`
+    if ($WORKDIR == NULL)
+      $outroot = `pwd`
+    else
+      $outroot = `ipp_datapath.pl $WORKDIR`
+    end
     $outroot = $outroot/$EXP_TAG
     $logfile = $outroot/detproc.$DET_ID.$CLASS_ID.log
@@ -166,7 +170,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
-    end
-    command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
+      echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA --workdir $outroot $ARGS
+    end
+    command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA --workdir $outroot $ARGS
   end
 
@@ -267,5 +271,9 @@
 
     # XXX push this into the filerules?
-    $outroot = `ipp_datapath.pl $WORKDIR`
+    if ($WORKDIR == NULL)
+      $outroot = `pwd`
+    else
+      $outroot = `ipp_datapath.pl $WORKDIR`
+    end
     $outroot = $outroot/$EXP_TAG
     $logfile = $outroot/detproc.$DET_ID.$ITERATION.log
@@ -279,7 +287,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
-    end
-    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
+      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA --workdir $outroot $ARGS
+    end
+    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA --workdir $outroot $ARGS
   end
 
